create_client
Add new clients to FreshBooks by entering their contact information and currency preferences for billing and invoicing.
Instructions
Create a new client.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| first_name | No | ||
| last_name | No | ||
| organization | No | ||
| phone | No | ||
| currency_code | No | USD |
Implementation Reference
- src/mcp_freshbooks/server.py:229-250 (handler)The `create_client` tool handler function, which takes client details, builds the request payload, and calls `client.accounting_create` to interact with the FreshBooks API.
async def create_client( email: str, first_name: str = "", last_name: str = "", organization: str = "", phone: str = "", currency_code: str = "USD", ) -> str: """Create a new client.""" data = {"email": email, "currency_code": currency_code} if first_name: data["fname"] = first_name if last_name: data["lname"] = last_name if organization: data["organization"] = organization if phone: data["mob_phone"] = phone result = await client.accounting_create("users/clients", "client", data) c = result.get("client", result) return f"Client created: {c.get('fname', '')} {c.get('lname', '')} (ID: {c.get('id')})"