---
title: "Create a tax code · Taxes · COUNT Partner API"
description: "Creates a tax code and its liability account. POST /partners/taxes"
canonical: "https://developers.getcount.com/reference/taxes/create-tax"
source: "https://developers.getcount.com/reference/taxes/create-tax"
---
[Taxes](https://developers.getcount.com/reference/taxes) / Create a tax code

# Create a tax code

POST `/partners/taxes`

Creates a tax code and its liability account.

The code is created enabled and editable. COUNT also creates its `Tax: <name>` liability account; in a US workspace the account sits under the shared Sales Tax Payable parent, which is created the first time it is needed.

HMAC signature + Bearer access token

[Try this request](https://developers.getcount.com/tools/try-it?method=POST&path=%2Fpartners%2Ftaxes&body=%7B%0A++%22name%22%3A+%22GST%22%2C%0A++%22percentage%22%3A+%2215%22%2C%0A++%22description%22%3A+%22Goods+and+services+tax%22%0A%7D)

[Transactions API](https://developers.getcount.com/reference/transactions) [Invoices API](https://developers.getcount.com/reference/invoices) [Bills API](https://developers.getcount.com/reference/bills)

#### Request body

`name` string required

Display name, up to 255 characters.

`percentage` string required

Rate as a percentage, zero or more: a number (`12.5`) or an unsigned numeric string (`"12.5"`). Stored to four decimal places.

`description` string

Description, or null.

#### Responses

`201` The new tax code.

`400` Validation failed (missing name, or a negative or non-numeric percentage), or a tax code with this name and percentage already exists.

`401` Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-401)

`403` The credential does not have access to this workspace or resource. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-403)

`429` Rate limit exceeded (100 requests per minute per user of each app, or 10,000 per minute per app). Retry after the Retry-After header. [Troubleshoot](https://developers.getcount.com/getting-started/errors#error-429)

[Previous GET Get a tax code](https://developers.getcount.com/reference/taxes/get-tax) [Next PATCH Update a tax code](https://developers.getcount.com/reference/taxes/update-tax)

POST `https://api.getcount.com/partners/taxes`

Request

```javascript
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 ACCESS_TOKEN = process.env.COUNT_ACCESS_TOKEN;

const method = 'POST';
const signingPath = '/taxes';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
  "name": "GST",
  "percentage": "15",
  "description": "Goods and services tax"
};
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}/partners/taxes`, {
  method,
  headers: {
    'x-client-id': CLIENT_ID,
    'x-timestamp': timestamp,
    'x-signature': signature,
    'Content-Type': 'application/json',
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
  body: bodyString,
});

console.log(await response.json());
```

Response · 201

```json
{
  "status": "success",
  "message": "Success on creating tax",
  "data": {
    "tax": {
      "id": "3f6c2a1e-8b4d-4e7a-9c2f-1d5e8a7b6c40",
      "name": "GST",
      "percentage": "15.0000",
      "type": "Sales Tax",
      "description": "Goods and services tax",
      "enabled": true,
      "editable": true,
      "systemCreated": false,
      "country": "NZ",
      "state": null,
      "county": null,
      "city": null,
      "zipCode": null,
      "locationCode": null
    }
  }
}
```
