# List Invoices — Fortnox

> Retrieve a list of invoices in Fortnox. See the documentation

- Key: `fortnox-list-invoices`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Fortnox (`fortnox`) — https://pipedream.com/apps/fortnox.md
- This page (HTML): https://pipedream.com/apps/fortnox/actions/list-invoices
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/fortnox/actions/list-invoices/list-invoices.mjs

## Description

Retrieve a list of invoices in Fortnox. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_Invoices/operation/list_20)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filter` | `string` | No | Filter the invoices |
| `costcenter` | `string` | No | Filter the invoices by cost center |
| `customername` | `string` | No | Filter the invoices by customer name |
| `customernumber` | `string` | No | Filter the invoices by customer number |
| `label` | `string` | No | Filter the invoices by label |
| `documentnumber` | `string` | No | Filter the invoices by document number |
| `fromdate` | `string` | No | Filter the invoices by from date |
| `todate` | `string` | No | Filter the invoices by to date |
| `fromfinalpaydate` | `string` | No | Filter the invoices by from final pay date |
| `tofinalpaydate` | `string` | No | Filter the invoices by to final pay date |
| `lastmodified` | `string` | No | Filter the invoices by last modified |
| `notcompleted` | `string` | No | Filter the invoices by not completed |
| `ocr` | `string` | No | Filter the invoices by OCR |
| `ourreference` | `string` | No | Filter the invoices by our reference |
| `project` | `string` | No | Filter the invoices by project |
| `sent` | `string` | No | Filter the invoices by sent |
| `externalinvoicereference1` | `string` | No | Filter the invoices by external invoice reference 1 |
| `externalinvoicereference2` | `string` | No | Filter the invoices by external invoice reference 2 |
| `yourreference` | `string` | No | Filter the invoices by your reference |
| `invoicetype` | `string` | No | Filter the invoices by invoice type |
| `articlenumber` | `string` | No | Filter the invoices by article number |
| `articledescription` | `string` | No | Filter the invoices by article description |
| `currency` | `string` | No | Filter the invoices by currency |
| `accountnumberfrom` | `string` | No | Filter the invoices by account number from |
| `accountnumberto` | `string` | No | Filter the invoices by account number to |
| `credit` | `string` | No | Filter the invoices by credit |
| `sortby` | `string` | No | Filter the invoices by sort by |
| `sortorder` | `string` | No | Filter the invoices by sort order |

## 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": "fortnox",
      },
    },
  },
)

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: "fortnox-list-invoices",
  arguments: {
    filter: "Filter",
    costcenter: "Cost Center",
  },
})
```

**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: "fortnox-list-invoices",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    fortnox: { authProvisionId: "apn_xxxxxxx" },
    filter: "Filter",
    costcenter: "Cost Center",
  },
})

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": "fortnox-list-invoices",
    "configured_props": {
      "fortnox": { "authProvisionId": "apn_xxxxxxx" },
      "filter": "Filter",
      "costcenter": "Cost Center"
    }
  }'
```

---

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