Taxes

Taxes #

Taxes are levies imposed by governments on businesses operating within their jurisdictions. The platform is equipped to handle virtually every kind of Transactional tax, be they Value Added, Sales or Witholding Taxes.

Properties #

Direct Properties #

PropertyTypeDefinition
NameStringA label to identify the Tax
CodeStringA symbol/acronym to identify the Tax
RateFloatThe rate of the Tax as a percentage

Indirect Properties #

PropertyTypeDefinition
AccountDictionaryThe Control Account of the Tax

Basics #

The parameters required to create a Discount Resource are the Name, Code and Rate.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/tax' \
--data-raw '{
	"name": "Output Vat",
    "code": "VAT",
    "rate" : 10,
    "account_id" : 1
}'
import requests

url = "https://api.microbooks.io/books/v1/tax"
body = {
    "name": "Output Vat",
    "code": "VAT",
    "rate" : 10,
    "account_id" : 1
}
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/tax',
    'headers': {'Authorization': 'Bearer <bearer_token>'},
    'body': '{
        "name": "Output Vat",
        "code": "VAT",
        "rate" : 10,
        "account_id" : 1
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "Output Vat",
    "code": "VAT",
    "rate" : 10,
    "account_id" : 1
}';
$request = new Request('POST', 'https://api.microbooks.io/books/v1/tax', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/books/v1/tax");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{
    \"name\": \"Output Vat\",
    \"code\": \"VAT\",
    \"rate\" : 10,
    \"account_id\" : 1
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Response #

{
    "status": "success",
    "message": "Tax: Output Vat (VAT) at 10.00% created successfully",
    "resource": {
        "name": "Output Vat",
        "code": "VAT",
        "rate": 10,
        "account_id": 1,
        "entity_id": 1,
        "id": 2,
        "account_type": [
            "CONTROL"
        ],
        "account": {
            "uuid": "9f1e37b9-7ccf-4292-aa64-b205eab9a37f",
            "id": 1,
            "entity_id": 1,
            "category_id": null,
            "currency_id": 1,
            "code": 9,
            "name": "Jamarcus Koss V",
            "description": null,
            "type": "Control",
            "is_closed": false
        }
    }
}

Errors #

Below are the Errors that are returned by the Tax Resource.

Detail CodeNameDefinition
100Orphaned ItemsCannot recycle the Tax Resource because it has dependent Resources
101Missing EntityThe Tax Resource requires an existing Entity because it is applied to Line Items used in Transactions, for the purpose of preparing Financial Statements which are scoped to an Entity
102Missing Applicable AccountThe Tax Resource requires an Account of type Account::CONTROL to which the amounts charged by the Tax will be posted
103Invalid Acount TypeThe Account type of the Account select for the Tax Resource must be Account::CONTROL