API Definitions

See API Specification

Anyone using the API should also become very familiar with our schema documentation which contains important details about individual database table columns.
See Definition Database Schema.

Definitions GET (single)

Version Added: 26.2.1

DefNum: Required in the URL.

Example Request:
GET /definitions/350

Example Response:
{
"DefNum": 350,
"Category": 25,
"category": "BlockoutTypes",
"ItemOrder": 5,
"ItemName": "General Blockout",
"ItemValue": "",
"IsHidden": "false",
"Supp": ""
}

200 OK
404 NotFound (with explanation)

Definitions GET (multiple)

Version Added: 21.1

Parameters: All optional.

Category: Integer value corresponding to a DefCat enum entry.
category: (Added in version 26.2.1) String value corresponding to a DefCat enum entry.
includeHidden: Either "true" or "false". When "true", hidden definitions will be returned alongside non-hidden definitions. Default "false".

Example Requests:
GET /definitions
GET /definitions?Offset=200
GET /definitions?category="AdjTypes"
GET /definitions?Category=1&includeHidden=true

Example Response:
[
{
"DefNum": 7,
"Category": 1,
"category": "AdjTypes",
"ItemOrder": 0,
"ItemName": "Sales Tax",
"ItemValue": "+",
"IsHidden": "false",
"Supp": ""
},
{
"DefNum": 8,
"Category": 1,
"category": "AdjTypes",
"ItemOrder": 1,
"ItemName": "Professional Discount",
"ItemValue": "-",
"IsHidden": "false",
"Supp": ""
},
{
"DefNum": 9,
"Category": 1,
"category": "AdjTypes",
"ItemOrder": 2,
"ItemName": "Cash Discount",
"ItemValue": "-",
"IsHidden": "false",
"Supp": ""
},
etc...
]

200 OK
400 BadRequest (with explanation)

Definitions POST (create)

Version Added: 22.1

Creates a new definition, attempts to set the Category (definition.Category) will be silently ignored.

category: Required. See the list of current Definitions for a valid definition.Category name.
ItemName: Required. Name of the definition.

ItemValue: Optional. Values will be validated differently for each Category.
IsHidden: Optional. Defaults to "false".
Supp: (Added in version 26.2.1) Optional. Can only be specified for the "AdjTypes" category, which uses this field as a default percentage (with valid values 0 through 1000). Default empty string.

Example Requests:
POST /definitions

{
"category": "PaymentTypes",
"ItemName": "Interest Payment"
}

or

{
"category": "AdjTypes",
"ItemName": "Cash Discount",
"ItemValue":"-",
"IsHidden":"false"
}

Example Response:
{
"DefNum": 12,
"Category": 1,
"category":"AdjTypes",
"ItemOrder": 17,
"ItemName": "Cash Discount",
"ItemValue":"-",
"IsHidden":"false",
"Supp": ""
}

201 Created
400 BadRequest (with explanation)

Definitions PUT

Version Added: 26.2.1

Updates an existing definition.

DefNum: Required in the URL.

ItemOrder: Optional. Numeric order of the definition within the definition Category. 0-indexed.
IsHidden: Optional. Either "true" or "false".

Example Request:
PUT /definitions/350

{
"ItemOrder": 5,
"IsHidden":"true"
}

Example Response:
{
"DefNum": 350,
"Category": 25,
"category": "BlockoutTypes",
"ItemOrder": 5,
"ItemName": "General Blockout",
"ItemValue": "",
"IsHidden": "true",
"Supp": ""
}

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)