---
title: "Add a GL Code"
method: POST
path: "/GlCodes/CreateGlCode"
tags: ["GlCodes"]
---

# Add a GL Code

`POST /GlCodes/CreateGlCode`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/GlCodes/CreateGlCode`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/GlCodes/CreateGlCode/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a GL Code with a new trade, category, or location.
            <br />Send the [GET /GlCodes/RetrieveGlCodes](/swagger/ui/index?version=3#/GlCodes/GETv3_GlCodes_RetrieveGlCodes_trade__trade__category__category__location__location_) request to get the list of GL Codes.

## Query parameters

- `glCode` string, required
- `trade` string
- `category` string
- `location` string

## Response `201`

The created GL Code ID is in the response.

- SystemObject

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 401 — Invalid subsriber ID 606 — Location is not found 704 — Invalid trade value for the subscriber 705 — Invalid category value for the subscriber 706 — GL Code already exists
- `401`: The request is not authorized. <br/>Error codes: 504 — API call rejected by security permissions
- `500`: The server was unable to complete the request due to an internal error.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
