Firm, Clients & MembersCreate a client workspace

Create a client workspace

POST/firm-partners/firm/clients

Creates a client workspace with its own books, owned and paid for by the firm.

The client gets full bookkeeping, the default chart of accounts for its country, and the firm’s staff as members, so the same key reaches it at once with `count-workspace-id` set to the returned `workspace.id`. The firm owns the client and is billed for it; the client does not sign in or approve anything. Needs the `firm:write` scope (the bare `write` grant also covers it) and a key with access to all client workspaces. Send `externalReference` to make retries safe: a firm client with that reference is returned with 200 and `created: false`, and the rest of the body is ignored. Creating a client takes several seconds.

HMAC signature only

Request body

namestringrequired

Workspace (business) name. Up to 255 characters.

countrystringrequired

Two-letter ISO country code, such as `US`. Decides the default chart of accounts and, when `currency` is not sent, the currency. Cannot be changed later.

currencystring

Three-letter ISO currency code. Defaults from `country`.

externalReferencestring

Your own id for this client, up to 255 characters, unique within the firm. Makes retries safe; returned on List client workspaces.

clientKindstring

Whether the client is an individual or a business.

One of: individual, business

emailstring

Workspace email. Addresses on disposable email domains are refused with 400.

websitestring

Workspace website.

typestring

Business type, as chosen in the app.

subTypestring

Business sub-type, as chosen in the app.

statestring

State or region of the business.

businessAddressobject

The business address. Every field is optional.

streetstring

Street line 1.

street2string

Street line 2.

citystring

City.

statestring

State or region.

zipCodestring

Postal code.

countrystring

Country.

contactDetailsobject

The client’s main contact. Every field is optional.

firstNamestring

First name.

lastNamestring

Last name.

emailstring

Email address.

phonestring

Phone number.

configurationobject

Workspace preferences.

timezonestring

IANA timezone, such as `America/Chicago`.

brandPrimaryColorstring

Brand colour as a hex value without `#`.

biostring

Short description of the business.

Responses

200The firm already has a client with this `externalReference`. Nothing new was created.
201The client workspace was created.
400The body is invalid (for example `country: Required`), or `email` is on a disposable email domain.
401Missing signing headers, an invalid HMAC signature, or a timestamp more than 5 minutes off. Troubleshoot
403The key’s scope lacks `firm:write`, the key is limited to selected client workspaces, or the key is inactive. Troubleshoot
409Another request with the same `externalReference` is still creating this client. Retry after a moment.
429The per-minute or daily client creation limit, or the 100 requests per minute rate limit, was reached. Troubleshoot
503The client could not be created right now. Retry with the same `externalReference`.
POSThttps://api.getcount.com/firm-partners/firm/clients
Request
import crypto from 'node:crypto';

const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;

const method = 'POST';
const signingPath = '/firm/clients';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
  "name": "Maple Grove HOA",
  "country": "US",
  "clientKind": "business",
  "email": "board@maplegrovehoa.example",
  "businessAddress": {
    "street": "1 Maple Grove Dr",
    "city": "Austin",
    "state": "TX",
    "zipCode": "78701",
    "country": "US"
  },
  "contactDetails": {
    "firstName": "Pat",
    "lastName": "Rivera",
    "email": "pat@maplegrovehoa.example",
    "phone": "+1 512 555 0142"
  },
  "externalReference": "hoa-27"
};
const bodyString = JSON.stringify(body);

const bodyHash = crypto.createHash('sha256').update(bodyString).digest('hex');
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');

const response = await fetch(`${BASE_URL}/firm-partners/firm/clients`, {
  method,
  headers: {
    'x-client-id': CLIENT_ID,
    'x-timestamp': timestamp,
    'x-signature': signature,
    'Content-Type': 'application/json',
  },
  body: bodyString,
});

console.log(await response.json());
Response · 200
{
  "status": "success",
  "message": "Client workspace already exists for this externalReference.",
  "data": {
    "workspace": {
      "id": "6f5e4d3c-2b1a-4c9d-8e7f-0a1b2c3d4e5f",
      "name": "Maple Grove HOA",
      "currency": "USD",
      "isOwnedByFirm": true,
      "externalReference": "hoa-27"
    },
    "created": false
  }
}