# Clear Books — Pipedream Connect

> Online Accounting Software

- API slug: `clear_books` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Business Management
- Website: https://www.clearbooks.co.uk/
- Managed OAuth scopes: `businesses:read` · `accounting.customers:read` · `accounting.customers:write` · `accounting.suppliers:read` · `accounting.suppliers:write` · `accounting.purchases:read` · `accounting.purchases:write` · `accounting.transactions:read`
- This page (HTML): https://pipedream.com/apps/clear-books
- Tools: 4 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: clear_books`

```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": "clear_books",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// e.g. run Create Customer:
const result = await mcp.callTool({
  name: "clear_books-create-customer",
  arguments: {
    name: "Name",
    email: "Email",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Clear Books endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.clearbooks.co.uk/v1/businesses

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuY2xlYXJib29rcy5jby51ay92MS9idXNpbmVzc2Vz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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: "clear_books-create-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    clear_books: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    email: "Email",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (4)

### `clear_books-create-customer` — Create Customer (Write)

Creates a new customer in Clear Books. See the documentation

Full schema: https://pipedream.com/apps/clear-books/actions/create-customer.md

### `clear_books-create-purchase-document` — Create Purchase Document (Write)

Creates a new Purchase Document in Clear Books. See the documentation

Full schema: https://pipedream.com/apps/clear-books/actions/create-purchase-document.md

### `clear_books-create-supplier` — Create Supplier (Write)

Creates a new supplier in Clear Books. See the documentation

Full schema: https://pipedream.com/apps/clear-books/actions/create-supplier.md

### `clear_books-list-supplier-id-options` — List Supplier ID Options (Read-only)

Retrieves available options for the Supplier ID field.

Full schema: https://pipedream.com/apps/clear-books/actions/list-supplier-id-options.md

## Triggers (3)

### `clear_books-new-customer-created` — New Customer Created (Polling)

Emit new event when a new customer is added to the system.

Full schema: https://pipedream.com/apps/clear-books/triggers/new-customer-created.md

### `clear_books-new-purchase-document-created` — New Purchase Document Created (Polling)

Emit new event when a new purchase document is created.

Full schema: https://pipedream.com/apps/clear-books/triggers/new-purchase-document-created.md

### `clear_books-new-transaction-created` — New Transaction Created (Polling)

Emit new event when a new transaction is created.

Full schema: https://pipedream.com/apps/clear-books/triggers/new-transaction-created.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
