Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Chart of Accounts > Create Accounting Code

Create Accounting Code

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 Z-Finance enabled on your tenant, you must have the Z-Finance Create Accounting Code permission. See Z-Finance Roles.

Request

  • Production: POST https://api.zuora.com/rest/v1/accounting-codes
  • API Sandbox: POST https://apisandbox-api.zuora.com/rest/v1/accounting-codes

Request Header Fields

Specify the following field in the request header.

Accept

optional

Optionally specify application/json. Only JSON is returned.

Request Body Fields

Specify the following fields in the body of the request.

name

required

Name of the accounting code.

Accounting code name must be unique. Maximum of 100 characters.

type

required

Accounting code type. Valid values are as follows:

  • Cash
  • OtherAssets
  • CustomerCashOnAccount
  • DeferredRevenue
  • SalesTaxPayable
  • OtherLiabilities
  • SalesRevenue
  • SalesDiscounts
  • OtherRevenue
  • OtherEquity
  • BadDebt
  • OtherExpenses

You cannot create new accounting codes of type AccountsReceivable.

glAccountName

optional

Name of the account in your general ledger.

Field only available if you have Z-Finance enabled. Maximum of 255 characters.

glAccountNumber

optional

Account number in your general ledger.

Field only available if you have Z-Finance enabled. Maximum of 255 characters.

notes

optional

Maximum of 2,000 characters.

<custom fields>

conditional

Custom fields you have configured for the accounting code object. If you have configured any required custom fields then you must specify them in the call.

You must use the API Name of the custom field.

Response

Response Body Fields

The following fields are returned in the body of the response.

success

Returns true if the request is successful. Otherwise, returns false.

reasons

Information describing the reason for the result. Returned only if success is false.

code

An eight-digit numeric error code.

message

A description of the error.

id

ID of the newly created accounting code.

Example

Example Request

POST https://apisandbox-api.zuora.com/rest/v1/accounting-codes

{
    "name": "CASH",
    "type": "Cash"
}

Example Response

{
    "id": "8a8081ae547aac1e01547efb61f20140",
    "success": true
}

 

Last modified
07:34, 19 May 2016

Tags

Classifications

(not set)