KosmoKrator

accounting

FreshBooks CLI for AI Agents

Use the FreshBooks CLI from KosmoKrator to call FreshBooks tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

8 functions 7 read 1 write Bearer token auth

FreshBooks CLI Setup

FreshBooks can be configured headlessly with `kosmokrator integrations:configure freshbooks`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure freshbooks --set access_token="$FRESHBOOKS_ACCESS_TOKEN" --set account_id="$FRESHBOOKS_ACCOUNT_ID" --enable --read allow --write ask --json
kosmokrator integrations:doctor freshbooks --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token FRESHBOOKS_ACCESS_TOKEN Secret secret yes Access Token
account_id FRESHBOOKS_ACCOUNT_ID Text text yes Account ID
url FRESHBOOKS_URL URL url no API Base URL

Call FreshBooks Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call freshbooks.freshbooks_list_invoices '{
  "search": "example_search",
  "page": 1,
  "per_page": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:freshbooks freshbooks_list_invoices '{
  "search": "example_search",
  "page": 1,
  "per_page": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs freshbooks --json
kosmo integrations:docs freshbooks.freshbooks_list_invoices --json
kosmo integrations:schema freshbooks.freshbooks_list_invoices --json
kosmo integrations:search "FreshBooks" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to FreshBooks.

freshbooks.freshbooks_list_invoices

Read read

List invoices from FreshBooks. Returns invoice details including status, amounts, client info, and dates. Supports filtering by status, client, date range, and more.

Parameters
search, page, per_page

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json

freshbooks.freshbooks_get_invoice

Read read

Get details of a specific FreshBooks invoice by ID. Returns full invoice data including line items, amounts, client details, status, and payment info.

Parameters
invoice_id

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_get_invoice '{"invoice_id":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_get_invoice '{"invoice_id":1}' --json

freshbooks.freshbooks_create_invoice

Write write

Create a new invoice in FreshBooks. Requires at minimum a client ID and line items. Supports setting due date, notes, discount, and other invoice fields.

Parameters
client_id, lines, date, due_date, invoice_number, notes, terms, discount_value, discount_type

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_create_invoice '{"client_id":1,"lines":"example_lines","date":"example_date","due_date":"example_due_date","invoice_number":"example_invoice_number","notes":"example_notes","terms":"example_terms","discount_value":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_create_invoice '{"client_id":1,"lines":"example_lines","date":"example_date","due_date":"example_due_date","invoice_number":"example_invoice_number","notes":"example_notes","terms":"example_terms","discount_value":1}' --json

freshbooks.freshbooks_list_clients

Read read

List clients from FreshBooks. Returns client details including name, email, company, and balance. Supports filtering and pagination.

Parameters
search, page, per_page

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_list_clients '{"search":"example_search","page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_list_clients '{"search":"example_search","page":1,"per_page":1}' --json

freshbooks.freshbooks_get_client

Read read

Get details of a specific FreshBooks client by ID. Returns full client profile including contact info, company details, and outstanding balance.

Parameters
client_id

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_get_client '{"client_id":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_get_client '{"client_id":1}' --json

freshbooks.freshbooks_list_projects

Read read

List projects from FreshBooks. Returns project details including title, description, billing method, budget, and active status. Supports filtering and pagination.

Parameters
search, page, per_page

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_list_projects '{"search":"example_search","page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_list_projects '{"search":"example_search","page":1,"per_page":1}' --json

freshbooks.freshbooks_list_payments

Read read

List payments from FreshBooks. Returns payment details including amount, date, client, invoice, and payment method. Supports filtering and pagination.

Parameters
search, page, per_page

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_list_payments '{"search":"example_search","page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_list_payments '{"search":"example_search","page":1,"per_page":1}' --json

freshbooks.freshbooks_get_current_user

Read read

Get the profile of the currently authenticated FreshBooks user. Returns user details including name, email, and linked business/member information. Useful for verifying connection and identity.

Parameters
none

Generic CLI call

kosmo integrations:call freshbooks.freshbooks_get_current_user '{}' --json

Provider shortcut

kosmo integrations:freshbooks freshbooks_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

freshbooks.freshbooks_list_invoices

List invoices from FreshBooks. Returns invoice details including status, amounts, client info, and dates. Supports filtering by status, client, date range, and more.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_list_invoices --json
ParameterTypeRequiredDescription
search object no Search filters. Keys: status (e.g., "sent", "paid", "draft"), clientid, date_from, date_to, invoice_number. Pass as an object.
page integer no Page number for pagination (default: 1).
per_page integer no Results per page (default: 15, max: 100).

freshbooks.freshbooks_get_invoice

Get details of a specific FreshBooks invoice by ID. Returns full invoice data including line items, amounts, client details, status, and payment info.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_get_invoice --json
ParameterTypeRequiredDescription
invoice_id integer yes The FreshBooks invoice ID.

freshbooks.freshbooks_create_invoice

Create a new invoice in FreshBooks. Requires at minimum a client ID and line items. Supports setting due date, notes, discount, and other invoice fields.

Operation
Write write
Schema command
kosmo integrations:schema freshbooks.freshbooks_create_invoice --json
ParameterTypeRequiredDescription
client_id integer yes The client ID to bill.
lines array yes Array of line items. Each line should have: name (string), description (string, optional), qty (number), unit_cost (object with amount and code).
date string no Invoice date (YYYY-MM-DD). Defaults to today.
due_date string no Due date (YYYY-MM-DD). Optional.
invoice_number string no Custom invoice number. Auto-generated if omitted.
notes string no Notes displayed on the invoice.
terms string no Payment terms (e.g., "Net 30").
discount_value number no Discount amount or percentage.
discount_type string no Discount type: "percentage" or "amount".

freshbooks.freshbooks_list_clients

List clients from FreshBooks. Returns client details including name, email, company, and balance. Supports filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_list_clients --json
ParameterTypeRequiredDescription
search object no Search filters. Keys: email, fname, lname, organization, state (active/archived). Pass as an object.
page integer no Page number for pagination (default: 1).
per_page integer no Results per page (default: 15, max: 100).

freshbooks.freshbooks_get_client

Get details of a specific FreshBooks client by ID. Returns full client profile including contact info, company details, and outstanding balance.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_get_client --json
ParameterTypeRequiredDescription
client_id integer yes The FreshBooks client ID.

freshbooks.freshbooks_list_projects

List projects from FreshBooks. Returns project details including title, description, billing method, budget, and active status. Supports filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_list_projects --json
ParameterTypeRequiredDescription
search object no Search filters. Keys: title, active (true/false), clientid. Pass as an object.
page integer no Page number for pagination (default: 1).
per_page integer no Results per page (default: 15, max: 100).

freshbooks.freshbooks_list_payments

List payments from FreshBooks. Returns payment details including amount, date, client, invoice, and payment method. Supports filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_list_payments --json
ParameterTypeRequiredDescription
search object no Search filters. Keys: clientid, invoiceid, date_from, date_to, type (check/credit/card/bank). Pass as an object.
page integer no Page number for pagination (default: 1).
per_page integer no Results per page (default: 15, max: 100).

freshbooks.freshbooks_get_current_user

Get the profile of the currently authenticated FreshBooks user. Returns user details including name, email, and linked business/member information. Useful for verifying connection and identity.

Operation
Read read
Schema command
kosmo integrations:schema freshbooks.freshbooks_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.