# FreshBooks on boxd

> FreshBooks is a cloud-based accounting software service designed for small and medium-sized businesses, offering features like invoicing, expense tracking, and time management.

- Page: https://boxd.sh/integrations/freshbooks/
- CLI: `run freshbooks` (10 commands, 6 marked common)
- SDK: `import { freshbooks } from "@boxd/run"`; every parameter and response type is at `@boxd/run/freshbooks`
- Triggers: none
- Connect: `run auth freshbooks` (Sign in with FreshBooks), or https://app.boxd.sh/integrations/detail/freshbooks
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth freshbooks      # once: prints a link to connect your account
run freshbooks           # list its commands
run freshbooks list-businesses
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, freshbooks } from "@boxd/run";

every("1 hour", async () => {
  const result = await freshbooks.listBusinesses();
  console.log(result);
});
```

Run it with `run freshbooks.run.ts`. FreshBooks has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run freshbooks <command> --help` lists the optional ones. "common" marks what `run freshbooks` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `create-webhook` ·common | `freshbooks.createWebhook()` | `--account-id` `--event` `--uri` | 0 | Register a new webhook callback for a FreshBooks account |
| `delete-webhook` | `freshbooks.deleteWebhook()` | `--account-id` `--callback-id` | 0 | Delete a webhook callback from a FreshBooks account |
| `get-business-users` ·common | `freshbooks.getBusinessUsers()` | `--business-id` | 0 | Retrieves staff identities and members for a specific FreshBooks business |
| `list-businesses` ·common | `freshbooks.listBusinesses()` | — | 0 | List all businesses associated with the authenticated user |
| `list-clients` ·common | `freshbooks.listClients()` | `--account-id` | 7 | Retrieves all clients for a FreshBooks account |
| `list-journal-entries2` ·common | `freshbooks.listJournalEntries2()` | `--business-uuid` | 2 | Retrieves all journal entries for a FreshBooks business account |
| `list-projects` ·common | `freshbooks.listProjects()` | `--business-id` | 6 | Retrieves all projects associated with a FreshBooks business account |
| `list-webhooks` | `freshbooks.listWebhooks()` | `--account-id` | 0 | List all webhook callbacks registered for a FreshBooks account |
| `register-as-new-user` | `freshbooks.registerAsNewUser()` | `--business-name` `--email` `--first-name` `--last-name` `--password` | 0 | Register a new user account in FreshBooks |
| `update-webhook` | `freshbooks.updateWebhook()` | `--account-id` `--callback-id` | 2 | Update or verify a FreshBooks webhook callback |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
