COUNTCOUNT
Sign Up
WorkspaceUpdate workspace GST settings

Update workspace GST settings

PATCH/partners/workspace/gst-settings

Updates one or more GST settings on the workspace.

A partial update — send only what you want to change, but send at least one field. The body is strict: an unrecognised key is rejected rather than ignored. `filingFrequency` and `accountingBasis` are matched case-insensitively. This route additionally requires the consenting user to hold the `manage_settings` permission in the workspace, and returns 403 when they do not.

HMAC signature + Bearer access token
Try this request

Request body

enabledboolean

Whether GST is enabled for the workspace.

irdNumberstring

IRD number, 50 characters or fewer. Never validated for format. Pass an empty string or null to clear it.

filingFrequencyenum

How often the workspace files a GST return.

One of: monthly, 2-monthly, 6-monthly

accountingBasisenum

Whether GST is accounted for when invoiced or when paid. Cannot be changed once the workspace has filed a return.

One of: invoice, payments

Responses

200The full GST settings after the patch is applied.
400Empty body, an unrecognised key, an invalid filingFrequency or accountingBasis, or an irdNumber over 50 characters.
403The consenting user does not hold the manage_settings permission in this workspace. Troubleshoot
409The GST accounting basis cannot be changed once returns have been filed — filed periods were snapshotted on the previous basis.
401Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. Troubleshoot
403The credential does not have access to this workspace or resource. Troubleshoot
429Rate limit exceeded (100 requests per minute per clientId). Retry after the Retry-After header. Troubleshoot
PATCHhttps://api.getcount.com/partners/workspace/gst-settings
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 = '/workspace/gst-settings';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
  "enabled": true,
  "filingFrequency": "2-monthly",
  "accountingBasis": "invoice",
  "irdNumber": "123-456-789"
};
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/workspace/gst-settings`, {
  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": "Workspace GST settings updated successfully.",
  "data": {
    "gstSettings": {
      "enabled": true,
      "irdNumber": "123-456-789",
      "filingFrequency": "2-monthly",
      "accountingBasis": "invoice",
      "taxRegime": "NZ_GST",
      "accountingBasisLocked": false
    }
  }
}