# Create or update an accounting code

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).

Endpoint: POST /v1/businesses/{client_id}/accounting-codes
Version: v1
Security: BearerAuth

## Path parameters:

  - `client_id` (integer, required)
    The ID of the business.

## Request fields (application/json):

  - `code` (string, required)
    The GL code string. Used as the upsert key — if a code with this value already exists it will be updated.
    Example: 4000

  - `name` (string, required)
    The display name of the GL code.
    Example: Office Expenses

## Response 200 fields (application/json):

  - `id` (string)
    The unique identifier for this GL code.
    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6

  - `code` (string)
    The GL code string used for bookkeeping export.
    Example: 4000

  - `name` (string)
    The display name of the GL code.
    Example: Office Expenses

  - `created` (string)
    When this GL code was created in UTC.
    Example: 2026-01-15T10:30:00Z

  - `updated` (string)
    When this GL code was last updated in UTC.
    Example: 2026-01-15T10:30:00Z

## Response 201 fields (application/json):

  - `id` (string)
    The unique identifier for this GL code.
    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6

  - `code` (string)
    The GL code string used for bookkeeping export.
    Example: 4000

  - `name` (string)
    The display name of the GL code.
    Example: Office Expenses

  - `created` (string)
    When this GL code was created in UTC.
    Example: 2026-01-15T10:30:00Z

  - `updated` (string)
    When this GL code was last updated in UTC.
    Example: 2026-01-15T10:30:00Z

