Categories

Endpoints

Get categories

POST/api/RPC.common.Api.Groups.get?token=<TOKEN>

Key Groups.get · Open page

Parameters

6 body parameters inside data[]
FieldTypeDescription
idIntegerCategory ID
coderequiredStringCategory ID
namerequiredStringCategory name
get_allBooleanGet all
offsetNumberOffset
limitNumberLimit

Request example

Search By Id:
{
   "data" : [
      {
         "id" : 2108822
      }
   ]
}
Search By Code:
{
   "data" : [
      {
         "code" : "TAX"
      }
   ]
}
Search By Name:
{
   "data" : [
      {
         "name" : "Taxes on delivery"
      }
   ]
}
Search By All Params:
{
   "data" : [
      {
         "code" : "TAX",
         "name" : "Taxes on delivery",
         "id" : 2108822
      }
   ]
}
Get All:
{
	"data":[
		{}
	],
	"get_all":1,
	"limit":10000,
	"offset":0
}

cURL

Search By Id:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{   "data" : [      {         "id" : 2108822      }   ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.get?token=<TOKEN>"
Search By Code:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{   "data" : [      {         "code" : "TAX"      }   ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.get?token=<TOKEN>"
Search By Name:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{   "data" : [      {         "name" : "Taxes on delivery"      }   ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.get?token=<TOKEN>"
Search By All Params:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{   "data" : [      {         "code" : "TAX",         "name" : "Taxes on delivery",         "id" : 2108822      }   ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.get?token=<TOKEN>"
Curl example Get All:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{	"data":[		{}	],	"get_all":1,	"limit":10000,	"offset":0}	' "https://<DOMAIN_NAME>/api/RPC.common.Api.Groups.get?token=<TOKEN>"

Response example

    HTTP/1.1 200 OK
{
   "result" : [
      {
         "income_allocation_id" : 21564,
         "name_multilang" : {
            "en" : "Taxes on delivery",
            "bg" : "Taxes on delivery"
         },
         "parent_id" : 2108821,
         "name" : "Taxes on delivery",
         "have_childs" : 0,
         "parent_name" : "Delivery costs",
         "expense_allocation_id" : 21601,
         "tp" : "services",
         "code" : "TAX",
         "id" : 2108822
      }
   ],
   "total_count" : 1,
   "count" : 1
}

Create Categories

POST/api/RPC.common.Api.Groups.set?token=<TOKEN>

Key Groups.set · Open page

Parameters

7 body parameters inside data[]
FieldTypeDescription
coderequiredStringCategory ID
namerequiredStringCategory name
typeStringGroup type
income_allocation_nameStringName of financial category for income
expense_allocation_nameStringName of financial category for expenses
parent_nameStringParent group name
parent_idStringParent 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)"
      }
   ]
}