Skip to content

Create or update an accounting code

Request

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

Security
BearerAuth
Path
client_idintegerrequired

The ID of the business.

Example:123
Bodyapplication/jsonrequired
codestring, <= 128 charactersrequired

The GL code string. Used as the upsert key — if a code with this value already exists it will be updated.

Example:"4000"
namestring, <= 150 charactersrequired

The display name of the GL code.

Example:"Office Expenses"
POST
/v1/businesses/{client_id}/accounting-codes
curl -i -X POST \
  https://public.letsweel.com/v1/businesses/123/accounting-codes \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "4000",
    "name": "Office Expenses"
  }'

Responses

OK (existing code updated or restored)

Bodyapplication/json
idstring, (uuid)

The unique identifier for this GL code.

Example:"3fa85f64-5717-4562-b3fc-2c963f66afa6"
codestring

The GL code string used for bookkeeping export.

Example:"4000"
namestring

The display name of the GL code.

Example:"Office Expenses"
createdstring, (date-time)

When this GL code was created in UTC.

Example:"2026-01-15T10:30:00Z"
updatedstring, (date-time)

When this GL code was last updated in UTC.

Example:"2026-01-15T10:30:00Z"
Response
{ "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "code": "4000", "name": "Office Expenses", "created": "2026-01-15T10:30:00Z", "updated": "2026-01-15T10:30:00Z" }