Taxes

Taxes #

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

Witholding Taxes #

Problem #

You want to create payment based (witholding) Taxes.

Solution #

Revenue Stream Categories #

You can create a witholding tax by calling the create Tax Resource endpoint with the witholding_tax attribute set to true.

Mixed Taxes
Witholding taxes cannot be combined with Transactional Taxes. This means that Line Items can either have Transactional or Witholding Taxes, but not both.

Request #

curl --location --request POST 'api.microbooks.io/books/v1/tax' \
--data-raw '{
	"name": "Tax Witheld on Payment",
    "code": "WHT",
    "rate" : 15,
    "account_id" : 2,
    "witholding_tax" : true
}'
import requests

url = "https://api.microbooks.io/books/v1/tax"
body = {
    "name": "Tax Witheld on Payment",
    "code": "WHT",
    "rate" : 15,
    "account_id" : 2,
    "witholding_tax" : true
}
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": "Tax Witheld on Payment",
        "code": "WHT",
        "rate" : 15,
        "account_id" : 2,
        "witholding_tax" : true
    }'
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
$client = new Client();
$body = '{
    "name": "Tax Witheld on Payment",
    "code": "WHT",
    "rate" : 15,
    "account_id" : 2,
    "witholding_tax" : true
}';
$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\": \"Tax Witheld on Payment\",
    \"code\": \"WHT\",
    \"rate\" : 15,
    \"account_id\" : 2,
    \"witholding_tax\" : true
}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);