---
title: "Create an accounting code"
method: POST
path: "/v1/accounting-codes"
tags: ["Accounting Codes"]
---

# Create an accounting code

`POST /v1/accounting-codes`

This reference describes how to create a new accounting code through the REST API. 
The accounting code will be active as soon as it has been created.

### Prerequisites
  If you have Zuora Finance enabled on your tenant, you must have the  Configure Accounting Codes permission.

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Track-Id` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Version` string

## Request body

- POSTAccountingCodeType — Container for custom fields of an Accounting Code object.
  - `glAccountName` string — Name of the account in your general ledger. Field only available if you have Zuora Finance enabled. Maximum of 255 characters.
  - `glAccountNumber` string — Account number in your general ledger. Field only available if you have Zuora Finance enabled. Maximum of 255 characters.
  - `name` string, required — Name of the accounting code. Accounting code name must be unique. Maximum of 100 characters.
  - `notes` string — Maximum of 2,000 characters.
  - `type` 'AccountsReceivable' | 'OnAccountReceivable' | 'Cash' | 'OtherAssets' | 'CustomerCashOnAccount' | 'DeferredRevenue' | 'SalesTaxPayable' | 'OtherLiabilities' | 'SalesRevenue' | 'SalesDiscounts' | 'OtherRevenue' | 'OtherEquity' | 'BadDebt' | 'OtherExpenses', required — If you want to create multiple accounting codes of the type `AccountsReceivable`, you need to have [Invoice Item Settlement](https://docs.zuora.com?resourceId=billing-invoice-item-settlement) enabled and contact [Zuora Global Support](http://support.zuora.com) to access the Multiple AR Accounting Codes feature. Note that `OnAccountReceivable` is only available if you enable the Invoice Settlement feature.
  - `segmentConstantValues` SegmentConstantValuesCustomFields — Segment constant values. The field is available only if you have GL Segmentation 2.0 enabled. This field is additional property.

## Response `200`

OK

- POSTAccountingCodeResponseType
  - `id` string — ID of the newly created accounting code.
  - `success` boolean — Returns `true` if the request was processed successfully.

## Other responses

- `500` — Internal Server Error
- `4XX` — Request Errors

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
