# List Expenses — Zoho Books

> List all the Expenses. See the documentation

- Key: `zoho_books-list-expenses`
- Type: Action (Read-only)
- Version: 0.3.1
- App: Zoho Books (`zoho_books`) — https://pipedream.com/apps/zoho-books.md
- This page (HTML): https://pipedream.com/apps/zoho-books/actions/list-expenses
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zoho_books/actions/list-expenses/list-expenses.mjs

## Description

List all the Expenses. [See the documentation](https://www.zoho.com/books/api/v3/expenses/#list-expenses)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `description` | `string` | No | Search expenses by description.Variants description_startswith and description_contains. Max-length [100] |
| `referenceNumber` | `string` | No | Search expenses by reference number. Variants reference_number_startswith and reference_number_contains. Max-length [100] |
| `date` | `string` | No | Search expenses by expense date. Variants date_start, date_end, date_before and date_after. Format [yyyy-mm-dd] |
| `status` | `string` | No | Search expenses by expense status. |
| `amount` | `string` | No | Search expenses by amount. |
| `accountName` | `string` | No | Search expenses by expense account name. Max-length [100] |
| `customerName` | `string` | No | Search expenses by customer name. Max-length [100] |
| `vendorName` | `string` | No | Search expenses by vendor name. |
| `customerId` | `string` | No | ID of the expense account. |
| `vendorId` | `string` | No | ID of the vendor the expense is made. |
| `recurringExpenseId` | `string` | No | Search expenses by recurring expense id. |
| `paidThroughAccountId` | `string` | No | Search expenses by paid through account id. |
| `searchText` | `string` | No | Search expenses by account name or description or customer name or vendor name. Max-length [100] |
| `sortColumn` | `string` | No | Sort expenses. |
| `filterBy` | `string` | No | Filter expenses by expense status. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "zoho_books",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "zoho_books-list-expenses",
  arguments: {
    description: "Description",
    referenceNumber: "Reference Number",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "zoho_books-list-expenses",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zoho_books: { authProvisionId: "apn_xxxxxxx" },
    description: "Description",
    referenceNumber: "Reference Number",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "zoho_books-list-expenses",
    "configured_props": {
      "zoho_books": { "authProvisionId": "apn_xxxxxxx" },
      "description": "Description",
      "referenceNumber": "Reference Number"
    }
  }'
```

---

- App: https://pipedream.com/apps/zoho-books.md · All apps: https://pipedream.com/apps
