Update a tax code
PATCH
/partners/taxes/{uuid}Renames, re-rates, describes, or switches a tax code on or off.
Send only the fields that change. Renaming a code renames its liability account. A rate cannot change once the code has been posted to the ledger. A system code (`editable: false`) keeps its name and rate, and a US sales tax code that is the rate for a customer job site cannot be switched off.
HMAC signature + Bearer access token
Try this requestPath parameters
uuiduuidrequiredThe tax UUID, the `id` from List tax codes.
Request body
namestringNew display name.
percentagestringNew rate, zero or more, as a number or an unsigned numeric string.
descriptionstringNew description, or null to clear it.
enabledboolean`false` stops the code being offered on new lines; `true` turns it back on.
Responses
200The updated tax code.400Empty body or invalid field; renaming or re-rating a system code; changing the rate of a code already posted to the ledger; or switching off a sales tax code a customer job site uses.404No tax code with that UUID in the workspace, or it has been deleted.401Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. Troubleshoot403The credential does not have access to this workspace or resource. Troubleshoot429Rate limit exceeded (100 requests per minute per user of each app, or 10,000 per minute per app). Retry after the Retry-After header. TroubleshootPATCH
https://api.getcount.com/partners/taxes/{uuid}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 ACCESS_TOKEN = process.env.COUNT_ACCESS_TOKEN;
const method = 'PATCH';
const signingPath = '/taxes/3f6c2a1e-8b4d-4e7a-9c2f-1d5e8a7b6c40';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
"name": "GST (standard)",
"enabled": true
};
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/3f6c2a1e-8b4d-4e7a-9c2f-1d5e8a7b6c40`, {
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 · 200
{
"status": "success",
"message": "Success on update tax",
"data": {
"tax": {
"id": "3f6c2a1e-8b4d-4e7a-9c2f-1d5e8a7b6c40",
"name": "CA Sales Tax (state)",
"percentage": "7.2500",
"type": "Sales Tax",
"description": "California state sales tax",
"enabled": true,
"editable": true,
"systemCreated": false,
"country": "US",
"state": "CA",
"county": null,
"city": null,
"zipCode": null,
"locationCode": null
}
}
}