# Accounting Codes

This group of endpoints allows you to manage GL codes (accounting codes) for your business.

GL codes are used to classify expenses for bookkeeping export. Businesses with a connected accounting integration (Xero, MYOB, NetSuite, QuickBooks, Business Central) cannot create or delete GL codes via the API — those are managed by the integration sync. Businesses with a manual integration or no integration can freely create, update, and delete GL codes. A manual integration is automatically created on the first POST if none exists.


## List accounting codes

 - [GET /v1/businesses/{client_id}/accounting-codes](https://developer.letsweel.com/openapi/accounting-codes/listaccountingcodes.md): Returns a paginated list of GL codes for the given business.

## Create or update an accounting code

 - [POST /v1/businesses/{client_id}/accounting-codes](https://developer.letsweel.com/openapi/accounting-codes/upsertaccountingcode.md): 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).

## Delete an accounting code

 - [DELETE /v1/businesses/{client_id}/accounting-codes/{accounting_code_id}](https://developer.letsweel.com/openapi/accounting-codes/deleteaccountingcode.md): Soft-deletes a GL code. Only available for businesses with a manual integration.

Any category mapped to this GL code will have its mapping cleared. Business admins and accountants will receive an ACCOUNTING_CODE_DELETED notification.

