Categories

Categories #

The sections below demonstrate how to solve common book keeping problems revolving around the Category resource.

Multiple Revenue Streams #

Problem #

You want to seperate your revenue by geographical location, customer type or any other arbitrary criteria.

Solution #

Revenue Stream Categories #

You can create a category for each revenue stream for the Operating Revenue and Operating Expense Account types. The balances from the Accounts belonging to these categories will be grouped together on the Income Statement Report.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/category' \
--data-raw '{
    "name": "Branch 1 Sales",
    "category_type": "OPERATING_REVENUE"
}'

##########################################################################

curl --location --request POST 'api.microbooks.io/books/v1/category' \
--data-raw '{
    "name": "Branch 1 COGS",
    "category_type": "OPERATING_EXPENSE"
}'
import requests

url = "https://api.microbooks.io/books/v1/category"
body = {
    "name": "Branch 1 Sales",
    "category_type": "OPERATING_REVENUE"
}
headers = {"Authorization": "Bearer <bearer_token>"}

response = requests.request("POST", url, headers=headers, json=body)

print(response.text)

##########################################################################

body = {
    "name": "Branch 1 COGS",
    "category_type": "OPERATING_EXPENSE"
}
headers = {"Authorization": "Bearer <bearer_token>"}

response = requests.request("POST", url, headers=headers, json=body)

print(response.text)
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.microbooks.io/books/v1/category',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "Branch 1 Sales",
        "category_type": "OPERATING_REVENUE"
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});

/************************************************************************/

var options = {
    'method': 'POST',
    'url': 'https://api.microbooks.io/books/v1/category',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "Branch 1 COGS",
        "category_type": "OPERATING_EXPENSE"
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "Branch 1 Sales",
    "category_type": "OPERATING_REVENUE"
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/category', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

/************************************************************************/

$body = '{
    "name": "Branch 1 COGS",
    "category_type": "OPERATING_EXPENSE"
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/category', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/books/v1/category");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{
    \"name": \"Branch 1 Sales\",
    \"category_type\": \"OPERATING_REVENUE\"
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

/************************************************************************/

var request = new RestRequest(Method.POST);
var body = "{
    \"name": \"Branch 1 COGS\",
    \"category_type\": \"OPERATING_EXPENSE\"
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Client/Supplier Segmentation #

Problem #

You want to segment your Customers/Suppliers according to some characteristic that they share.

Solution #

Client/Supplier Categories #

You can create a category for each segment for the Receivable/Payable Account types. The balances from the Accounts belonging to these categories will be grouped together on the Balance Sheet Report.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/category' \
--data-raw '{
    "name": "International Clients", # or Suppliers
    "category_type": "RECEIVABLE" # or PAYABLE
}'
import requests

url = "https://api.microbooks.io/books/v1/category"
body = {
    "name": "International Clients", # or Suppliers
    "category_type": "RECEIVABLE" # or PAYABLE
}
headers = {"Authorization": "Bearer <bearer_token>"}

response = requests.request("POST", url, headers=headers, json=body)

print(response.text)
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.microbooks.io/books/v1/category',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "International Clients", // or Suppliers
        "category_type": "RECEIVABLE" // or PAYABLE
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "International Clients", // or Suppliers
    "category_type": "RECEIVABLE" // or PAYABLE
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/category', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/books/v1/category");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{
    \"name": \"International Clients\", // or Suppliers
    \"category_type\": \"RECEIVABLE\" // or PAYABLE
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Cash and Bank Accounts #

Problem #

You want to distinguish between Cash in Hand (Petty Cash) and Bank Accounts.

Solution #

A Petty Cash Category #

You can create a ‘Petty Cash’ or similar category for the Bank Account type to represent Cash held in hand. The balances from the Accounts belonging to this category will be displayed seperately from the regular Bank Accounts on the Balance Sheet Report.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/category' \
--data-raw '{
    "name": "Petty Cash",
    "category_type": "BANK"
}'
import requests

url = "https://api.microbooks.io/books/v1/category"
body = {
    "name": "Petty Cash",
    "category_type": "BANK"
}
headers = {"Authorization": "Bearer <bearer_token>"}

response = requests.request("POST", url, headers=headers, json=body)

print(response.text)
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.microbooks.io/books/v1/category',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "Petty Cash",
        "category_type": "BANK"
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "Petty Cash",
    "category_type": "BANK"
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/category', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/books/v1/category");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{
    \"name": \"Petty Cash\", 
    \"category_type\": \"BANK\"
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Group Expenses #

Problem #

You want to group related expenses together.

Solution #

Expense Categories #

You can create a category for each segment for the Direct, Overhead or Other Expense Account types. The balances from the Accounts belonging to these categories will be grouped together on the Income Statement Report.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/category' \
--data-raw '{
    "name": "Motor Vehicle Expenses",
    "category_type": "DIRECT_EXPENSE"
}'
import requests

url = "https://api.microbooks.io/books/v1/category"
body = {
    "name": "Motor Vehicle Expenses",
    "category_type": "DIRECT_EXPENSE"
}
headers = {"Authorization": "Bearer <bearer_token>"}

response = requests.request("POST", url, headers=headers, json=body)

print(response.text)
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.microbooks.io/books/v1/category',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "Motor Vehicle Expenses",
        "category_type": "DIRECT_EXPENSE"
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "Motor Vehicle Expenses",
    "category_type": "DIRECT_EXPENSE"
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/category', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/books/v1/category");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{
    \"name": \"Motor Vehicle Expenses\", 
    \"category_type\": \"DIRECT_EXPENSE\"
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);