...

/

Create and Update a Client

Create and Update a Client

Learn to create a new client and update it using the FreshBooks API.

In the previous lesson, we extracted the ACCOUNT_ID of the authenticated user. Here, the user is an admin who manages and interacts with the application. They're responsible for making all API calls. Meanwhile, a client is an entity for which a user maintains records.

This chapter walks us through some of the operations related to clients and contacts. In this lesson, we’ll create a new client and update it using the following endpoints:

  • Create and list clients: /accounting/account/{ACCOUNT_ID}/users/clients

  • Update a client: /accounting/account/{ACCOUNT_ID}/users/clients/{CLIENT_ID}

Note: These endpoints of clients require user:clients:read and user:clients:write permissions to perform the intended tasks.

In this section, we’ll create a new client using the /accounting/account/{ACCOUNT_ID}/users/clients endpoint. This endpoint ...

Parameter Name

Type

Category

Description

email

String

Optional

A valid email associated with the client

fname

String

Optional

The first name of the client

lname

String

Optional

The last name of the client

organization

String

Optional

The name of the client's business. If the organization is not provided, it is automatically added by combining fname and lname of the client

p_street

String

Optional

A street address associated with the billing

p_city

String

Optional

Defines the billing city

p_province

String

Optional

Defines the billing province

p_code

String

Optional

Defines the postal billing code

Let's create a new client in the code widget ...