Calculate Taxes Based off Specific Incomes

Users that have inconsistent incomes may benefit from the Smart Tax Rate calculation for withholding.

The Smart Tax Rate changes dynamically, adjusting for the user's outstanding tax liability. The Smart Tax Rate finds the taxes owed on specific incomes (e.g., a paycheck, invoice payment, or a collection of incomes) that have not yet been withheld.

The Smart Tax Rate can always be found by calling the GET /users/{userId}/taxes/{year} API endpoint.

curl \
  --request GET \
  --url https://sandbox-api.withabound.com/v2/users/<<testUserId>>/taxes/2020 \
  --header 'Authorization: Bearer <<apiKey>>'
const { default: Abound, Environment } = require("@withabound/node-sdk");

const abound = new Abound({
  appId: "<<sandbox_app_id>>",
  appSecret: "<<sandbox_app_secret>>",
  environment: Environment.SANDBOX,
  apiVersion: "v2",
});

(async () => {
  const response = await abound.taxes.retrieve(
    "<<testUserId>>",
    "2020"
  );
  
  console.log(response);
})();
import requests

url = "https://sandbox-api.withabound.com/v2/users/<<testUserId>>/taxes/2020"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer <<apiKey>>"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
//import com.withabound.AboundConfig;
//import com.withabound.models.*;
//import com.withabound.resources.base*;

AboundConfig aboundConfig = new AboundConfig(
  "<<sandbox_app_id>>",
  "<<sandbox_app_secret>>",
  AboundEnvironment.SANDBOX,
  AboundApiVersion.V2
);

Abound abound = new Abound(aboundConfig);
String userId = "<<testUserId>>";
String year = "2020";

AboundResponse<Tax> response = abound.taxes().retrieve(userId, year);

System.out.println(response.getData().getTotalTax());
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://sandbox-api.withabound.com/v2/users/<<testUserId>>/taxes/2020"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Accept", "application/json")
    req.Header.Add("Authorization", "Bearer <<apiKey>>")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
// using RestSharp;

var client = new RestClient("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/taxes/2020");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer <<apiKey>>");
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/taxes/2020")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer <<apiKey>>'

response = http.request(request)
puts response.read_body
{
  "data": {
    "smartTaxRate": 0.2310
  }
}

The Smart Tax Rate finds your user's tax liability on any income and enables you to calculate the estimated amount to withhold.

For example, if your user earned $1000 in 1099 income, you can find the taxes owed on this income by taking $1000 and multiplying it by the smartTaxRate divided by 100. If the Smart Tax Rate were 21.30%, you would display your user's tax liability on this $1000 income as $213.00.

const incomeAmount = 1000.00;
const smartTaxRate = 21.3 / 100;
const taxesOwed = incomeAmount * smartTaxRate;
console.log(taxesOwed); // returns 213

Did this page help you?