View as Markdown
Clear Books icon

Clear Books ACTION

Create Purchase Document

Creates a new Purchase Document in Clear Books. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Clear Books account once, then configure and run Create Purchase Document from your backend or agent.

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-purchase-document",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    clear_books: { authProvisionId: "apn_xxxxxxx" },
    purchaseType: "Purchase Type",
    date: "Date",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Purchase Document inputs
Property Type Description
purchaseType Purchase Type string
Type of purchase document
Required
date Date string
The date of the purchase. Format: YYYY-MM-DD
Required
supplierId Supplier ID string
The identifier of a supplier
Required Dynamic
description Description string
Description of the purchase document
Optional
numLineItems Number of Line Items integer
The number of line items. Use this to manually enter Unit Price, Quantity, and Description of each line item.
Optional
lineItemsJson Line Items JSON string
JSON value containing an array of Line Items. For example: [{"description":"Line Item 1 Description","unitPrice":1022,"quantity":1,"accountCode":"2001001"},{"description":"Line Item 2 Description","unitPrice":1023,"quantity":2,"accountCode":"2001001"}]. See documentation
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
clear_books-create-purchase-document
Version
0.0.2
App
Clear Books
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes