> ## Documentation Index
> Fetch the complete documentation index at: https://exsited.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounting codes

> List, create, read, update and delete the accounting codes that carry general ledger account numbers and names.

An accounting code is a settings record that carries a general ledger account number and name and a code type such as `sales_revenue`. You can list, create, read, update and delete accounting codes. This area has 5 endpoints, and all seven SDKs call every one.

## At a glance

| Endpoint | Method | Path | What it does |
| - | - | - | - |
| [List accounting codes](https://exsited.mintlify.site/api-reference/accounting-codes/list-accounting-codes.md) | GET | `/settings/accounting_codes` | Returns a page of accounting codes under `data`, with paging details under `pagination`. |
| [Create an accounting code](https://exsited.mintlify.site/api-reference/accounting-codes/create-an-accounting-code.md) | POST | `/settings/accounting_codes` | Creates an accounting code and returns it under `accounting_code`. |
| [Retrieve an accounting code](https://exsited.mintlify.site/api-reference/accounting-codes/retrieve-an-accounting-code.md) | GET | `/settings/accounting_codes/{accounting_code_id}` | Returns one accounting code by its `id`, under `accounting_code`. |
| [Delete an accounting code](https://exsited.mintlify.site/api-reference/accounting-codes/delete-an-accounting-code.md) | DELETE | `/settings/accounting_codes/{accounting_code_id}` | Deletes an accounting code. The response has no body. |
| [Update an accounting code](https://exsited.mintlify.site/api-reference/accounting-codes/update-an-accounting-code.md) | PATCH | `/settings/accounting_codes/{accounting_code_id}` | Changes the fields you send on an accounting code and returns it under `accounting_code`. |

## Before you call

Register your API credentials once when your app starts, as shown in
[Authentication](https://exsited.mintlify.site/authentication.md). Every SDK sample on these pages then gets its client in one line.
With cURL, send the access token in an `Authorization` header: `Authorization: Bearer $ACCESS_TOKEN`.

## Things to know

* **Requests and responses wrap the record in `accounting_code`.** A create sends `{"accounting_code": {...}}` and a read returns the record under the same key.
* **A create sets the code type with `account_code_type`.** The stored record reports the same value in `default_match_key`, such as `sales_revenue`.
* **Discount profiles need a discount accounting code.** A discount profile accepts only an accounting code whose `default_match_key` is `discount`.
* **Listings page by cursor.** Records sit under `data`; pass `pagination.next_cursor` as `cursor` to read the next page, and stop when `pagination.has_more` is `false`.
* **A delete returns `204` with no body.** Reading the accounting code afterwards returns `404`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.