data
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.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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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 |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call freshbooks.freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:freshbooks freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json Discovery
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 Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
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.
read - Parameters
- search, page, per_page
kosmo integrations:call freshbooks.freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:freshbooks freshbooks_list_invoices '{"search":"example_search","page":1,"per_page":1}' --json 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.
read - Parameters
- invoice_id
kosmo integrations:call freshbooks.freshbooks_get_invoice '{"invoice_id":1}' --json kosmo integrations:freshbooks freshbooks_get_invoice '{"invoice_id":1}' --json 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.
write - Parameters
- client_id, lines, date, due_date, invoice_number, notes, terms, discount_value, discount_type
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 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
List clients from FreshBooks. Returns client details including name, email, company, and balance. Supports filtering and pagination.
read - Parameters
- search, page, per_page
kosmo integrations:call freshbooks.freshbooks_list_clients '{"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:freshbooks freshbooks_list_clients '{"search":"example_search","page":1,"per_page":1}' --json 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.
read - Parameters
- client_id
kosmo integrations:call freshbooks.freshbooks_get_client '{"client_id":1}' --json kosmo integrations:freshbooks freshbooks_get_client '{"client_id":1}' --json freshbooks.freshbooks_list_projects
List projects from FreshBooks. Returns project details including title, description, billing method, budget, and active status. Supports filtering and pagination.
read - Parameters
- search, page, per_page
kosmo integrations:call freshbooks.freshbooks_list_projects '{"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:freshbooks freshbooks_list_projects '{"search":"example_search","page":1,"per_page":1}' --json freshbooks.freshbooks_list_payments
List payments from FreshBooks. Returns payment details including amount, date, client, invoice, and payment method. Supports filtering and pagination.
read - Parameters
- search, page, per_page
kosmo integrations:call freshbooks.freshbooks_list_payments '{"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:freshbooks freshbooks_list_payments '{"search":"example_search","page":1,"per_page":1}' --json 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.
read - Parameters
- none
kosmo integrations:call freshbooks.freshbooks_get_current_user '{}' --json 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 3 parameters
kosmo integrations:schema freshbooks.freshbooks_list_invoices --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema freshbooks.freshbooks_get_invoice --json | Parameter | Type | Required | Description |
|---|---|---|---|
invoice_id | integer | yes | The FreshBooks invoice ID. |
freshbooks.freshbooks_create_invoice 9 parameters
kosmo integrations:schema freshbooks.freshbooks_create_invoice --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 3 parameters
kosmo integrations:schema freshbooks.freshbooks_list_clients --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema freshbooks.freshbooks_get_client --json | Parameter | Type | Required | Description |
|---|---|---|---|
client_id | integer | yes | The FreshBooks client ID. |
freshbooks.freshbooks_list_projects 3 parameters
kosmo integrations:schema freshbooks.freshbooks_list_projects --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 3 parameters
kosmo integrations:schema freshbooks.freshbooks_list_payments --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 0 parameters
kosmo integrations:schema freshbooks.freshbooks_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.