Create

Create a new category.

Tokens

This action requires the following tokens:

  • category-write

Arguments

Required arguments are marked in bold, and optional arguments are marked in italics.

Argument Type Default Description
name String   The name for this category.
description String   The description for this category.
parent Hash   The hash of the category that will be the parent of this category

Output

This action produces the following output on success:

An object containing the following fields:

Name Type Description
id Hash Category ID
name String The name of this category
description String the description of this category
datecreated DateTime When this category was created
datemodified DateTime When this category was last modified
parent

The parent of this category, if any

The value of this field is an object containing the following fields:

Name Type Description
id Hash Category ID
name String The name of this category
account

The Account associated with this category

The value of this field is an object containing the following fields:

Name Type Description
id Hash Account ID
name String Account name
customer

The Customer associated with this category

The value of this field is an object containing the following fields:

Name Type Description
id Hash Customer ID
name String The name of this customer
datecreated DateTime When this customer was created
datemodified DateTime When this customer was last modified

Errors

This action can return one of the default status codes, or one of the following status codes on error:

STATUS_CATEGORY_NOT_FOUND (210)
If the category specified in “parent” can not be found
STATUS_ACCESS_DENIED (4)