---
title: "Create or update an accounting code"
method: POST
path: "/v1/businesses/{client_id}/accounting-codes"
tags: ["Accounting Codes"]
---

# Create or update an accounting code

`POST /v1/businesses/{client_id}/accounting-codes`

Creates or updates a GL code for the business (upsert by `code`).

- If a GL code with the given `code` already exists, its `name` is updated.
- If a previously soft-deleted GL code with that `code` exists, it is restored.
- Otherwise a new record is created.

Only available for businesses with a manual integration or no integration. If no integration exists, a manual integration is automatically created. Returns `400` if the business has a connected accounting provider (Xero, MYOB, NetSuite, QuickBooks, Business Central).

## Path parameters

- `client_id` integer, required

## Request body

- CreateAccountingCodeRequest
  - `code` string, required — The GL code string. Used as the upsert key — if a code with this value already exists it will be updated.
  - `name` string, required — The display name of the GL code.

## Response `200`

OK (existing code updated or restored)

- AccountingCode
  - `id` string, uuid — The unique identifier for this GL code.
  - `code` string — The GL code string used for bookkeeping export.
  - `name` string — The display name of the GL code.
  - `created` string, date-time — When this GL code was created in UTC.
  - `updated` string, date-time — When this GL code was last updated in UTC.

## Other responses

- `201` — Created
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/letsweel/apis/weel-openapi.md) · [All operations](https://skmtc.net/letsweel/apis/weel-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/letsweel/weel-openapi/revisions/55da5fa350fb/schema)
