Create Categories
This endpoint is deprecated.
POST
/api/RPC.common.Api.Groups.set?token=<TOKEN>Parameters
| Field | Type | Description |
|---|---|---|
coderequired | String | Category ID |
namerequired | String | Category name |
type | String | Group type |
income_allocation_name | String | Name of financial category for income |
expense_allocation_name | String | Name of financial category for expenses |
parent_name | String | Parent group name |
parent_id | String | Parent category ID |
Request example
Create Category First Level:
{
"data" : [
{
"name" : "Test Category (ZMU)",
"code" : "ZMU"
}
]
}
Create Category With Parent Category:
{
"data" : [
{
"code" : "ZMU",
"name" : "Test Category (ZMU)",
"parent_name" : "Scan Station"
}
]
}
Create Category With Parent Category And Allocations:
{
"data" : [
{
"expense_allocation_name" : "Expenses for Foreign Exchange Transactions",
"parent_name" : "Scan Station",
"income_allocation_name" : "Other income",
"code" : "ZMU",
"name" : "Test Category (ZMU)"
}
]
}cURL
Create Category First Level:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{ "data" : [ { "name" : "Test Category (ZMU)", "code" : "ZMU" } ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.set?token=<TOKEN>"
Create Category With Parent Category:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{ "data" : [ { "code" : "ZMU", "name" : "Test Category (ZMU)", "parent_name" : "Scan Station" } ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.set?token=<TOKEN>"
Create Category With Parent Category And Allocations:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{ "data" : [ { "expense_allocation_name" : "Expenses for Foreign Exchange Transactions", "parent_name" : "Scan Station", "income_allocation_name" : "Other income", "code" : "ZMU", "name" : "Test Category (ZMU)" } ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.set?token=<TOKEN>"Response example
HTTP/1.1 200 OK
{
"count" : 1,
"result" : [
{
"expense_allocation_id" : 21661,
"parent_name" : "Scan Station",
"expense_allocation_name" : "Expenses for Foreign Exchange Transactions",
"income_allocation_name" : "Other income",
"code" : "ZMU",
"id" : "unique_id int()",
"income_allocation_id" : 21559,
"name" : "Test Category (ZMU)"
}
]
}