# Fyle

> Review and manage Fyle expenses and reports: approve, send back, comment and mark paid, and keep projects and cost centers in step.

App · 26 actions. Web page: https://docs.lodol.com/docs/integrations/fyle

## Actions

### Approve an expense report

Approve an expense report as an admin.

**Inputs**

- Report (`report_id`, text, required): The report to approve.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Comment on an expense

Add a comment to an expense, and tell its owner if you choose.

**Inputs**

- Expense ID (`expense_id`, text, required): The expense to comment on.
- Comment (`comment`, text, required): The comment.
- Notify the employee (`notify`, true/false): Tell the expense's owner about the comment.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "action": "example",
        "comment": "example",
        "created_at": "example",
        "creator_user_id": "example",
        "expense_id": "example",
        "id": "example"
      }
    ]
  }
}
```

### Comment on an expense report

Add a comment to an expense report.

**Inputs**

- Report (`report_id`, text, required): The report to comment on.
- Comment (`comment`, text, required): The comment.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "comment": "example",
      "created_at": "example",
      "creator_user_id": "example",
      "id": "example",
      "report_id": "example"
    }
  }
}
```

### Create a cost center

Create a cost center that expenses can be charged to.

**Inputs**

- Name (`name`, text, required): The cost center's name.
- Code (`code`, text): A code to match the cost center in another system.
- Description (`description`, text): A description.
- Enabled (`is_enabled`, true/false): Whether employees can use the cost center. Leave empty for enabled.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "code": "example",
      "created_at": "example",
      "description": "example",
      "id": 1,
      "is_enabled": true,
      "name": "example",
      "updated_at": "example"
    }
  }
}
```

### Create a project

Create a project that expenses can be filed against.

**Inputs**

- Name (`name`, text, required): The project's name.
- Sub-project (`sub_project`, text): A sub-project name, shown as Name / Sub-project.
- Code (`code`, text): A code to match the project in another system.
- Description (`description`, text): A description.
- Enabled (`is_enabled`, true/false): Whether employees can use the project. Leave empty for enabled.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "approver_user_ids": [
        "example"
      ],
      "category_ids": [
        1
      ],
      "code": "example",
      "created_at": "example",
      "description": "example",
      "display_name": "example",
      "id": 1,
      "is_enabled": true,
      "name": "example",
      "sub_project": "example",
      "updated_at": "example"
    }
  }
}
```

### Create an expense

Create an expense for an employee, as an admin.

**Inputs**

- Employee email (`employee_email`, text, required): The email address of the employee the expense belongs to.
- Amount (`amount`, number, required): The amount, in the organization's currency. At least 0.
- Spent at (`spent_at`, date and time, required): When the money was spent. It can't be in the future.
- Purpose (`purpose`, text): What the expense was for.
- Merchant (`merchant`, text): Who was paid.
- Category (`category_id`, number): The expense category.
- Project (`project_id`, number): The project the expense is for.
- Cost center (`cost_center_id`, number): The cost center the expense is charged to.
- Billable (`is_billable`, true/false): Whether the expense can be billed to a client.
- Reference code (`code`, text): Your own reference for the expense, such as an ID in another system.
- Reimbursable (`is_reimbursable`, true/false): Whether the employee is paid back for it. Leave empty for Fyle's default.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "admin_amount": 1,
      "amount": 1,
      "category": {
        "display_name": "example",
        "id": 1,
        "name": "example",
        "sub_category": "example"
      },
      "category_id": 1,
      "claim_amount": 1,
      "code": "example",
      "cost_center": {
        "code": "example",
        "id": 1,
        "name": "example"
      },
      "cost_center_id": 1,
      "created_at": "example",
      "currency": "example",
      "employee_id": "example",
      "file_ids": [
        "example"
      ],
      "foreign_amount": 1,
      "foreign_currency": "example",
      "id": "example",
      "is_billable": true,
      "is_exported": true,
      "is_manually_flagged": true,
      "is_policy_flagged": true,
      "is_reimbursable": true,
      "is_verified": true,
      "merchant": "example",
      "project": {
        "display_name": "example",
        "id": 1,
        "name": "example",
        "sub_project": "example"
      },
      "project_id": 1,
      "purpose": "example",
      "report_id": "example",
      "seq_num": "example",
      "source": "example",
      "spent_at": "example",
      "state": "DRAFT",
      "state_display_name": "example",
      "tax_amount": 1,
      "updated_at": "example",
      "user": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "user_id": "example"
    }
  }
}
```

### Delete a cost center

Delete a cost center that no expense or other record uses yet. Fyle refuses one in use.

**Inputs**

- Cost center (`cost_center_id`, number, required): The cost center to delete.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Delete a project

Delete a project that no expense or other record uses yet. Fyle refuses one in use.

**Inputs**

- Project (`project_id`, number, required): The project to delete.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Delete an expense

Delete an expense. This can't be undone.

**Inputs**

- Expense ID (`expense_id`, text, required): The expense to delete.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Get an expense

Get one expense with its amount, state, category, project and report.

**Inputs**

- Expense ID (`expense_id`, text, required): The expense to read, such as txAbC123.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "admin_amount": 1,
    "amount": 1,
    "category": {
      "display_name": "example",
      "id": 1,
      "name": "example",
      "sub_category": "example"
    },
    "category_id": 1,
    "claim_amount": 1,
    "code": "example",
    "cost_center": {
      "code": "example",
      "id": 1,
      "name": "example"
    },
    "cost_center_id": 1,
    "created_at": "example",
    "currency": "example",
    "employee_id": "example",
    "file_ids": [
      "example"
    ],
    "foreign_amount": 1,
    "foreign_currency": "example",
    "id": "example",
    "is_billable": true,
    "is_exported": true,
    "is_manually_flagged": true,
    "is_policy_flagged": true,
    "is_reimbursable": true,
    "is_verified": true,
    "merchant": "example",
    "project": {
      "display_name": "example",
      "id": 1,
      "name": "example",
      "sub_project": "example"
    },
    "project_id": 1,
    "purpose": "example",
    "report_id": "example",
    "seq_num": "example",
    "source": "example",
    "spent_at": "example",
    "state": "DRAFT",
    "state_display_name": "example",
    "tax_amount": 1,
    "updated_at": "example",
    "user": {
      "email": "example",
      "full_name": "example",
      "id": "example"
    },
    "user_id": "example"
  }
}
```

### Get an expense report

Get one expense report with its state, amount and approvers.

**Inputs**

- Report (`report_id`, text, required): The report to read.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "created_at": "example",
    "currency": "example",
    "employee_id": "example",
    "id": "example",
    "is_exported": true,
    "is_manually_flagged": true,
    "is_policy_flagged": true,
    "is_verified": true,
    "last_approved_at": "example",
    "last_paid_at": "example",
    "last_submitted_at": "example",
    "next_approver_user_ids": [
      "example"
    ],
    "num_expenses": 1,
    "purpose": "example",
    "reimbursement_id": "example",
    "seq_num": "example",
    "state": "DRAFT",
    "state_display_name": "example",
    "tax": 1,
    "updated_at": "example",
    "user": {
      "email": "example",
      "full_name": "example",
      "id": "example"
    },
    "user_id": "example"
  }
}
```

### Get my profile

Get the connected person's profile, their roles and their organization.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "org": {
        "currency": "example",
        "domain": "example",
        "id": "example",
        "name": "example"
      },
      "org_id": "example",
      "roles": [
        "example"
      ],
      "user": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "user_id": "example"
    }
  }
}
```

### List advance requests

List employees' requests for cash advances, newest first.

**Inputs**

- State (`state`, text): Only requests in this state. One of: `DRAFT`, `APPROVAL_PENDING` (Awaiting approval), `APPROVED`, `SENT_BACK` (Sent back), `PULLED_BACK` (Pulled back), `REJECTED`, `PAID`.
- Employee (`employee_id`, text): Only this employee's records.
- Updated since (`updated_since`, date and time): Only records changed at or after this time.
- Limit (`limit`, number): How many advance requests to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many advance requests to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "amount": 1,
        "code": "example",
        "created_at": "example",
        "currency": "example",
        "employee_id": "example",
        "id": "example",
        "is_exported": true,
        "last_approved_at": "example",
        "notes": "example",
        "project_id": 1,
        "purpose": "example",
        "seq_num": "example",
        "state": "DRAFT",
        "updated_at": "example",
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### List categories

List the organization's expense categories.

**Inputs**

- Name contains (`name`, text): Only categories whose name contains this text.
- Enabled (`is_enabled`, true/false): Only enabled categories, or only disabled ones.
- Limit (`limit`, number): How many categories to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many categories to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "code": "example",
        "created_at": "example",
        "display_name": "example",
        "id": 1,
        "is_enabled": true,
        "name": "example",
        "sub_category": "example",
        "system_category": "example",
        "updated_at": "example"
      }
    ],
    "offset": 1
  }
}
```

### List corporate card transactions

List corporate card transactions, newest first, with whether each is matched to an expense.

**Inputs**

- Status (`status`, text): Only posted or only pending transactions. One of: `POSTED`, `PENDING`.
- Assigned to user ID (`assigned_user_id`, text): Only transactions assigned to this person (their user ID).
- Updated since (`updated_since`, date and time): Only records changed at or after this time.
- Limit (`limit`, number): How many transactions to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many transactions to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "amount": 1,
        "category": "example",
        "created_at": "example",
        "currency": "example",
        "description": "example",
        "foreign_amount": 1,
        "foreign_currency": "example",
        "id": "example",
        "is_assigned": true,
        "is_dismissed": true,
        "is_exported": true,
        "is_marked_personal": true,
        "matched_expense_ids": [
          "example"
        ],
        "mcc": "example",
        "merchant": "example",
        "post_date": "example",
        "spent_at": "example",
        "transaction_status": "POSTED",
        "updated_at": "example",
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### List cost centers

List the organization's cost centers.

**Inputs**

- Name contains (`name`, text): Only cost centers whose name contains this text.
- Enabled (`is_enabled`, true/false): Only enabled cost centers, or only disabled ones.
- Limit (`limit`, number): How many cost centers to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many cost centers to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "code": "example",
        "created_at": "example",
        "description": "example",
        "id": 1,
        "is_enabled": true,
        "name": "example",
        "updated_at": "example"
      }
    ],
    "offset": 1
  }
}
```

### List employees

List the organization's employees with their email addresses. Find one by email.

**Inputs**

- Email (`email`, text): Only the employee with exactly this email address.
- Enabled (`is_enabled`, true/false): Only enabled employees, or only disabled ones.
- Limit (`limit`, number): How many employees to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many employees to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "approver_user_ids": [
          "example"
        ],
        "code": "example",
        "created_at": "example",
        "department_id": "example",
        "has_accepted_invite": true,
        "id": "example",
        "is_enabled": true,
        "joined_at": "example",
        "level_id": "example",
        "mobile": "example",
        "updated_at": "example",
        "user": {
          "email": "example",
          "full_name": "example",
          "id": "example"
        },
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### List expense reports

List the organization's expense reports, newest first. Filter by state, employee or when they changed.

**Inputs**

- State (`state`, text): Only reports in this state. One of: `DRAFT`, `APPROVER_PENDING` (Awaiting approval), `APPROVER_INQUIRY` (Sent back), `APPROVED`, `PAYMENT_PENDING` (Payment pending), `PAYMENT_PROCESSING` (Payment processing), `PAID`.
- Employee (`employee_id`, text): Only this employee's records.
- Updated since (`updated_since`, date and time): Only records changed at or after this time.
- Limit (`limit`, number): How many reports to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many reports to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "amount": 1,
        "created_at": "example",
        "currency": "example",
        "employee_id": "example",
        "id": "example",
        "is_exported": true,
        "is_manually_flagged": true,
        "is_policy_flagged": true,
        "is_verified": true,
        "last_approved_at": "example",
        "last_paid_at": "example",
        "last_submitted_at": "example",
        "next_approver_user_ids": [
          "example"
        ],
        "num_expenses": 1,
        "purpose": "example",
        "reimbursement_id": "example",
        "seq_num": "example",
        "state": "DRAFT",
        "state_display_name": "example",
        "tax": 1,
        "updated_at": "example",
        "user": {
          "email": "example",
          "full_name": "example",
          "id": "example"
        },
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### List expenses

List the organization's expenses, newest first. Filter by state, employee, report or when they changed.

**Inputs**

- State (`state`, text): Only expenses in this state. One of: `DRAFT`, `COMPLETE` (Complete (not yet reported)), `APPROVER_PENDING` (Awaiting approval), `APPROVED`, `PAYMENT_PENDING` (Payment pending), `PAYMENT_PROCESSING` (Payment processing), `PAID`, `UNREPORTABLE` (Can't be reported).
- Employee (`employee_id`, text): Only this employee's records.
- Report (`report_id`, text): Only the expenses on this report.
- Updated since (`updated_since`, date and time): Only records changed at or after this time.
- Spent on or after (`spent_from`, date and time): Only expenses spent on or after this time.
- Limit (`limit`, number): How many expenses to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many expenses to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "admin_amount": 1,
        "amount": 1,
        "category": {
          "display_name": "example",
          "id": 1,
          "name": "example",
          "sub_category": "example"
        },
        "category_id": 1,
        "claim_amount": 1,
        "code": "example",
        "cost_center": {
          "code": "example",
          "id": 1,
          "name": "example"
        },
        "cost_center_id": 1,
        "created_at": "example",
        "currency": "example",
        "employee_id": "example",
        "file_ids": [
          "example"
        ],
        "foreign_amount": 1,
        "foreign_currency": "example",
        "id": "example",
        "is_billable": true,
        "is_exported": true,
        "is_manually_flagged": true,
        "is_policy_flagged": true,
        "is_reimbursable": true,
        "is_verified": true,
        "merchant": "example",
        "project": {
          "display_name": "example",
          "id": 1,
          "name": "example",
          "sub_project": "example"
        },
        "project_id": 1,
        "purpose": "example",
        "report_id": "example",
        "seq_num": "example",
        "source": "example",
        "spent_at": "example",
        "state": "DRAFT",
        "state_display_name": "example",
        "tax_amount": 1,
        "updated_at": "example",
        "user": {
          "email": "example",
          "full_name": "example",
          "id": "example"
        },
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### List projects

List the organization's projects.

**Inputs**

- Name contains (`name`, text): Only projects whose name contains this text.
- Enabled (`is_enabled`, true/false): Only enabled projects, or only disabled ones.
- Limit (`limit`, number): How many projects to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many projects to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "approver_user_ids": [
          "example"
        ],
        "category_ids": [
          1
        ],
        "code": "example",
        "created_at": "example",
        "description": "example",
        "display_name": "example",
        "id": 1,
        "is_enabled": true,
        "name": "example",
        "sub_project": "example",
        "updated_at": "example"
      }
    ],
    "offset": 1
  }
}
```

### List reimbursements

List reimbursements paid to employees, newest first.

**Inputs**

- Employee (`employee_id`, text): Only this employee's records.
- Paid since (`paid_since`, date and time): Only reimbursements paid at or after this time.
- Limit (`limit`, number): How many reimbursements to return, up to 200. From 1 to 200. Default: `50`.
- Offset (`offset`, number): How many reimbursements to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "amount": 1,
        "code": "example",
        "created_at": "example",
        "currency": "example",
        "employee_id": "example",
        "id": "example",
        "is_exported": true,
        "mode": "ACH",
        "paid_at": "example",
        "purpose": "example",
        "reimbursement_number": "example",
        "updated_at": "example",
        "user_id": "example"
      }
    ],
    "offset": 1
  }
}
```

### Mark an expense report as paid

Mark an approved expense report as paid, when you reimbursed it outside Fyle.

**Inputs**

- Report (`report_id`, text, required): The report that was paid.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Send back an expense report

Send an expense report back to the employee, saying why.

**Inputs**

- Report (`report_id`, text, required): The report to send back.
- Reason (`comment`, text, required): Why you're sending the report back.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "amount": 1,
      "created_at": "example",
      "currency": "example",
      "employee_id": "example",
      "id": "example",
      "is_exported": true,
      "is_manually_flagged": true,
      "is_policy_flagged": true,
      "is_verified": true,
      "last_approved_at": "example",
      "last_paid_at": "example",
      "last_submitted_at": "example",
      "next_approver_user_ids": [
        "example"
      ],
      "num_expenses": 1,
      "purpose": "example",
      "reimbursement_id": "example",
      "seq_num": "example",
      "state": "DRAFT",
      "state_display_name": "example",
      "tax": 1,
      "updated_at": "example",
      "user": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "user_id": "example"
    }
  }
}
```

### Submit expenses as a report

Put an employee's expenses on a new expense report and submit it for approval, on their behalf.

**Inputs**

- Expense IDs (`expense_ids`, list, required): The expenses to submit, such as txAbC123. They must belong to the same employee and not be on a report yet.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {}
}
```

### Update a project

Rename a project, or change its code, description or whether it's enabled.

**Inputs**

- Project (`project_id`, number, required): The project to change.
- Name (`name`, text, required): The project's name. Fyle needs it on every change: enter the current name to keep it.
- Sub-project (`sub_project`, text): A sub-project name.
- Code (`code`, text): A code to match the project in another system.
- Description (`description`, text): A description.
- Enabled (`is_enabled`, true/false): Whether employees can use the project.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "approver_user_ids": [
        "example"
      ],
      "category_ids": [
        1
      ],
      "code": "example",
      "created_at": "example",
      "description": "example",
      "display_name": "example",
      "id": 1,
      "is_enabled": true,
      "name": "example",
      "sub_project": "example",
      "updated_at": "example"
    }
  }
}
```

### Update an expense

Change an expense's purpose, merchant, amount, category, project, cost center or billable flag. Only the fields you fill in change.

**Inputs**

- Expense ID (`expense_id`, text, required): The expense to change.
- Amount (`amount`, number): The new amount, in the organization's currency. At least 0.
- Purpose (`purpose`, text): What the expense was for.
- Merchant (`merchant`, text): Who was paid.
- Category (`category_id`, number): The expense category.
- Project (`project_id`, number): The project the expense is for.
- Cost center (`cost_center_id`, number): The cost center the expense is charged to.
- Billable (`is_billable`, true/false): Whether the expense can be billed to a client.
- Reference code (`code`, text): Your own reference for the expense, such as an ID in another system.

**Outputs**

- `data` (object): The response from Fyle.

**Example output**

```json
{
  "data": {
    "data": {
      "admin_amount": 1,
      "amount": 1,
      "category": {
        "display_name": "example",
        "id": 1,
        "name": "example",
        "sub_category": "example"
      },
      "category_id": 1,
      "claim_amount": 1,
      "code": "example",
      "cost_center": {
        "code": "example",
        "id": 1,
        "name": "example"
      },
      "cost_center_id": 1,
      "created_at": "example",
      "currency": "example",
      "employee_id": "example",
      "file_ids": [
        "example"
      ],
      "foreign_amount": 1,
      "foreign_currency": "example",
      "id": "example",
      "is_billable": true,
      "is_exported": true,
      "is_manually_flagged": true,
      "is_policy_flagged": true,
      "is_reimbursable": true,
      "is_verified": true,
      "merchant": "example",
      "project": {
        "display_name": "example",
        "id": 1,
        "name": "example",
        "sub_project": "example"
      },
      "project_id": 1,
      "purpose": "example",
      "report_id": "example",
      "seq_num": "example",
      "source": "example",
      "spent_at": "example",
      "state": "DRAFT",
      "state_display_name": "example",
      "tax_amount": 1,
      "updated_at": "example",
      "user": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "user_id": "example"
    }
  }
}
```
