FreshBooks ACTION
Update Invoice
Update an existing invoice in FreshBooks. See the documentation
- Action
- Writes data
- Destructive
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's FreshBooks account once, then configure and run Update 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-update-invoice",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
freshbooks: { authProvisionId: "apn_xxxxxxx" },
accountId: "Account ID",
invoiceId: "Invoice ID",
},
})
console.log(result)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": "freshbooks-update-invoice",
"configured_props": {
"freshbooks": { "authProvisionId": "apn_xxxxxxx" },
"accountId": "Account ID",
"invoiceId": "Invoice ID"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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": "freshbooks",
},
},
},
)
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: "freshbooks-update-invoice",
arguments: {
accountId: "Account ID",
invoiceId: "Invoice ID",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
accountId Account ID | string | The FreshBooks account ID (accounting system id). Required Dynamic |
invoiceId Invoice ID | string | The ID of the invoice Required Dynamic |
clientId Client ID | string | The client (customer) ID to invoice Optional 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-update-invoice
- Version
- 0.0.1
- App
- FreshBooks
- Authentication
- OAuth
- Read-only
- No
- Destructive
- Yes
- Open world
- Yes
- Source
- View on GitHub ↗