Determine Expense Deductibility
Abound® can help automatically discover tax deductible business expenses, identify tax categories, and find a corresponding deduction value for your users.
1: Create A User
To create a new User call the POST /users
API endpoint. You can also follow the Getting Started guide to create a User.
2: Create an Expense
Next, add a new expense by calling the POST /users/{userId}/expenses
API endpoint. If the expenseType
value is returned as business
you will know the expense is tax deductible.
If tax deductible, the corresponding taxCategory
and deductionAmount
will be included in the response.
curl \
--request POST \
--url https://sandbox-api.withabound.com/v2/users/<<testUserId>>/expenses \
--header 'Authorization: Bearer <<apiKey>>' \
--header 'Content-Type: application/json' \
--data '{
"expenses": [
{
"amount": 139.99,
"date": "2020-04-15",
"description": "Tax Filing Fee",
"expenseType": "business",
"taxCategory": "Legal and Professional Fees"
},
{
"amount": 1437.52,
"description": "Wells Fargo Card Ccpymt",
"date": "2020-04-10",
"expenseType": "personal"
},
{
"amount": 206.01,
"description": "Sales Meeting",
"date": "2020-04-12"
}
]
}'
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.expenses.create(
"<<testUserId>>",
[
{
amount: 139.99,
date: "2020-04-15",
description: "Tax Filing Fee",
expenseType: "business",
taxCategory: "Legal and Professional Fees",
},
{
amount: 1437.52,
description: "Wells Fargo Card Ccpymt",
date: "2020-04-10",
expenseType: "personal",
},
{
amount: 206.01,
description: "Sales Meeting",
date: "2020-04-12",
},
]
);
console.log(response);
})();
import requests
url = "https://sandbox-api.withabound.com/v2/users/<<testUserId>>/expenses"
payload = {"expenses": [
{
"amount": 139.99,
"date": "2020-04-15",
"description": "Tax Filing Fee",
"expenseType": "business",
"taxCategory": "Legal and Professional Fees"
},
{
"amount": 1437.52,
"description": "Wells Fargo Card Ccpymt",
"date": "2020-04-10",
"expenseType": "personal"
},
{
"amount": 206.01,
"description": "Sales Meeting",
"date": "2020-04-12"
}
]}
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer <<apiKey>>"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
// import com.squareup.okhttp.*;
// import com.google.gson.JsonObject;
// import com.google.gson.JsonArray;
// 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>>";
ExpenseRequest expenseRequestOne = ExpenseRequest.builder()
.amount(139.99)
.description("Tax Filing Fee")
.date("2020-04-15")
.expenseType(ExpenseType.BUSINESS)
.taxCategory("Legal and Professional Fees")
.build();
ExpenseRequest expenseRequestTwo = ExpenseRequest.builder()
.amount(1437.52)
.description("Wells Fargo Card Ccpymt")
.date("2020-04-10")
.expenseType(ExpenseType.PERSONAL)
.build();
ExpenseRequest expenseRequestThree = ExpenseRequest.builder()
.amount(206.01)
.description("Sales Meeting")
.date("2020-04-12")
.build();
AboundBulkResponse<Expense> response = abound.expenses()
.create(userId, Arrays.asList(
expenseRequestOne,
expenseRequestTwo,
expenseRequstThree));
System.out.println(response.getData()); // list of created Expenses
package main
import (
"bytes"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://sandbox-api.withabound.com/v2/users/<<testUserId>>/expenses"
var requestBody = []byte(`{
"expenses": [
{
"amount": 139.99,
"date": "2020-04-15",
"description": "Tax Filing Fee",
"expenseType": "business",
"taxCategory": "Legal and Professional Fees"
},
{
"amount": 1437.52,
"description": "Wells Fargo Card Ccpymt",
"date": "2020-04-10",
"expenseType": "personal"
},
{
"amount": 206.01,
"description": "Sales Meeting",
"date": "2020-04-12"
}
]
}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "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>>/expenses");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <<apiKey>>");
request.AddJsonBody(new {
expenses = new[] {
new {
amount = 139.99,
date = "2020-04-15",
description = "Tax Filing Fee",
expenseType = "business",
taxCategory = "Legal and Professional Fees"
},
new {
amount = 1437.52,
description = "Wells Fargo Card Ccpymt",
date = "2020-04-10",
expenseType = "personal"
},
new {
amount = 206.01,
description = "Sales Meeting",
date = "2020-04-12"
}
}
});
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
require 'openssl'
require 'json'
url = URI("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/expenses")
requestBody = {
expenses: [
{
amount: 139.99,
date: "2020-04-15",
description: "Tax Filing Fee",
expenseType: "business",
taxCategory: "Legal and Professional Fees"
},
{
amount: 1437.52,
description: "Wells Fargo Card Ccpymt",
date: "2020-04-10",
expenseType: "personal"
},
{
amount: 206.01,
description: "Sales Meeting",
date: "2020-04-12"
}
]
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Bearer <<apiKey>>'
request.body = requestBody.to_json
response = http.request(request)
puts response.read_body
{
"data": [
{
"expenseId": "expenseId_testB1FBA298F0154D1906F18AF8C8D97FDCBD28",
"amount": 139.99,
"description": "Tax Filing Fee",
"date": "2020-04-15",
"expenseType": "business",
"taxCategory": "Legal and Professional Fees",
"deductionAmount": 139.99,
"predictions": {}
},
{
"expenseId": "expenseId_test495DB2C7F905E5DDDFD03B12029D8FB99084",
"amount": 1437.52,
"description": "Wells Fargo Card Ccpymt",
"date": "2020-04-10",
"expenseType": "personal",
"taxCategory": null,
"deductionAmount": 0,
"predictions": {
"taxCategoryPredictionScores": {
"Advertising and Marketing": 0.05218,
"Car and Truck": 0.0937,
"Commission and Fees": 0.00056,
"Contract Labor": 0.00352,
"Depletion": 6e-05,
"Depreciation": 2e-05,
"Employee Benefits Program": 0.00624,
"Insurance": 0.06961,
"Interest (Mortgage)": 0.00012,
"Interest (Other)": 0.00326,
"Legal and Professional Fees": 0.12655,
"Office Expense": 0.041,
"Pension and Profit Sharing": 0.00125,
"Rent (Vehicles and Equipment)": 0.00051,
"Rent (Business Property)": 0.00777,
"Repairs and Maintenance": 0.00749,
"Supplies": 0.0228,
"Taxes and Licenses": 0.0025,
"Travel": 0.00388,
"Meals": 0.37615,
"Utilities": 0.10757,
"Wages": 0.00204,
"Other": 0.07123
}
}
},
{
"expenseId": "expenseId_testf86dd836000a95e298aa418634718ffad6ec",
"amount": 206.01,
"description": "Sales Meeting",
"date": "2020-04-12",
"expenseType": "business",
"taxCategory": "Meals",
"deductionAmount": 103,
"predictions": {
"expenseTypePredictionScores": {
"0": 0.007482942659408,
"1": 0.992517054080963
},
"taxCategoryPredictionScores": {
"Advertising and Marketing": 0.05218,
"Car and Truck": 0.0937,
"Commission and Fees": 0.00056,
"Contract Labor": 0.00352,
"Depletion": 6e-05,
"Depreciation": 2e-05,
"Employee Benefits Program": 0.00624,
"Insurance": 0.06961,
"Interest (Mortgage)": 0.00012,
"Interest (Other)": 0.00326,
"Legal and Professional Fees": 0.12655,
"Office Expense": 0.041,
"Pension and Profit Sharing": 0.00125,
"Rent (Vehicles and Equipment)": 0.00051,
"Rent (Business Property)": 0.00777,
"Repairs and Maintenance": 0.00749,
"Supplies": 0.0228,
"Taxes and Licenses": 0.0025,
"Travel": 0.00388,
"Meals": 0.37615,
"Utilities": 0.10757,
"Wages": 0.00204,
"Other": 0.07123
}
}
}
]
}
Updated 2 months ago
Did this page help you?