View as Markdown
FreshBooks icon

FreshBooks ACTION

Create Invoice

Create a new invoice in FreshBooks. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's FreshBooks account once, then configure and run Create Invoice 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: "freshbooks-create-invoice",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    freshbooks: { authProvisionId: "apn_xxxxxxx" },
    accountId: "Account ID",
    clientId: "Client ID",
  },
})

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 Invoice inputs
Property Type Description
accountId Account ID string
The FreshBooks account ID (accounting system id).
Required Dynamic
clientId Client ID string
The client (customer) ID to invoice
Required Dynamic
invoiceNumber Invoice Number string
User-specified and visible invoice id
Optional
createDate Create Date string
Invoice date (YYYY-MM-DD). Defaults to today if not set
Optional
generationDate Generation Date string
Date invoice generated from object, null if it wasn't, YYYY-MM-DD (string) if it was
Optional
discountValue Discount Value (%) string
Discount percentage (0-100) applied to the subtotal
Optional
discountDescription Discount Description string
Public note about the discount
Optional
poNumber PO Number string
Reference number for address on invoice
Optional
currencyCode Currency Code string
Three-letter currency code (e.g. USD, CAD)
Optional
language Language string
Two-letter language code (e.g. en, fr)
Optional
terms Terms string
Terms listed on the invoice
Optional
notes Notes string
Notes displayed on the invoice
Optional
address Address string
First line of address on invoice
Optional
street Street string
Street for address on invoice
Optional
street2 Street 2 string
Second line of street for address on invoice
Optional
city City string
City for address on invoice
Optional
province Province string
Province for address on invoice
Optional
code Code string
Zip code for address on invoice
Optional
country Country string
Country for address on invoice
Optional
dueOffsetDays Due Offset Days integer
Number of days from creation that invoice is due. If not set, the due date will default to the date of issue
Optional
lines Line Items string[]
A list of line items. Example: [{"lineId":1, "unit_cost":{"amount":"10.50","code":"USD"}, "updated":"2020-01-01 12:00:00" }] See the 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
freshbooks-create-invoice
Version
0.0.1
App
FreshBooks
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes