# CreateGLAccount

Create a new GL account

`POST /api/v2/companies/{companyid}/glaccounts`

**API:** AvaTax API
**Tag:** GLAccount
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/crossborder/api/methods/GLAccount/CreateGLAccount/

## Description

Creates one or more new GL account objects attached to this company.

A GL account is a general ledger account that can be passed to transactions at the line level to apply the multiple rules of the transactions, including exemptions, allocations, etc. to a specific general ledger.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyid` | integer | path | Yes | The ID of the company that owns this GL Account object |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `GLAccountRequestModel`

GL account request model

| Property | Type | Required | Description |
|---|---|---|---|
| `entityUseCode` | string | No | The entity use code Example: `G`. |
| `effectiveDate` | string | No | The "effective from" date Example: `2026-07-02T04:05:12.1525253+00:00`. |
| `endDate` | string | No | The end date Example: `2026-07-02T04:05:12.1525771+00:00`. |
| `defaultItem` | Int64TaxProfileObjectReferenceModel | No | The default item for this GL account |
| `glAccountCode` | string | **Yes** | The GL account code Example: `GLAccount1`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Created | `GLAccountSuccessResponseModel` |
| 400 | Bad Request | `TaxProfileErrorResponseModel` |
| 401 | Unauthorized | `TaxProfileErrorResponseModel` |
| 403 | Forbidden | `TaxProfileErrorResponseModel` |
| 404 | Not Found | `TaxProfileErrorResponseModel` |

### 201 Response: `GLAccountSuccessResponseModel`

GL account response model

| Property | Type | Required | Description |
|---|---|---|---|
| `glAccountId` | integer | No | The GL account ID Example: `0`. |
| `companyId` | integer | No | The company ID to which this GL account belongs Example: `1`. |
| `meta` | TaxProfileMetaDataModel | No | Meta data of this GL account |
| `entityUseCode` | string | No | The entity use code Example: `G`. |
| `effectiveDate` | string | No | The "effective from" date Example: `2026-07-02T04:05:12.1696153+00:00`. |
| `endDate` | string | No | The end date Example: `2026-07-02T04:05:12.1696162+00:00`. |
| `defaultItem` | Int64TaxProfileObjectReferenceModel | No | The default item for this GL account |
| `glAccountCode` | string | **Yes** | The GL account code Example: `GLAccount1`. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyid}/glaccounts" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "entityUseCode": "G",
  "effectiveDate": "2026-07-02",
  "endDate": "2026-07-02",
  "defaultItem": {
    "identifier": 0
  },
  "glAccountCode": "GLAccount1"
}'
```