Deduction Finder

Abound can help you automatically discover tax deductible business expenses, identify tax categories, and find a corresponding deduction value for your users.

How to Tell If a Business Expense is Tax Deductible

If you haven't done so already, follow the Creating a User guide and ensure you have the resulting userId available for the next step.

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;

OkHttpClient client = new OkHttpClient();

JsonObject requestBody = new JsonObject();
JsonArray expenses = new JsonArray();
JsonObject expenseOne = new JsonObject();
JsonObject expenseTwo = new JsonObject();
JsonObject expenseThree = new JsonObject();

expenseOne.addProperty("amount", 139.99);
expenseOne.addProperty("date", "2020-04-15");
expenseOne.addProperty("description", "Tax Filing Fee");
expenseOne.addProperty("expenseType", "business");
expenseOne.addProperty("taxCategory", "Legal and Professional Fees");

expenseTwo.addProperty("amount", 1437.52);
expenseTwo.addProperty("date", "2020-04-10");
expenseTwo.addProperty("description", "Wells Fargo Card Ccpymt");
expenseTwo.addProperty("expenseType", "personal");

expenseThree.addProperty("amount", 206.01);
expenseThree.addProperty("date", "2020-04-12");
expenseThree.addProperty("description", "Sales Meeting");

expenses.add(expenseOne);
expenses.add(expenseTwo);
expenses.add(expenseThree);

requestBody.add("expenses", expenses);

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, requestBody.toString());
Request request = new Request.Builder()
  .url("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/expenses")
  .post(body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer <<apiKey>>")
  .build();

Response response = client.newCall(request).execute();
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
    },
    {
      "expenseId": "expenseId_test495DB2C7F905E5DDDFD03B12029D8FB99084",
      "amount": 1437.52,
      "description": "Wells Fargo Card Ccpymt",
      "date": "2020-04-10",
      "expenseType": "personal",
      "deductionAmount": 0
    },
    {
      "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": 0.00006,
          "Depreciation": 0.00002,
          "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
        }
      }
    }
  ]
}

Field

Description

amount

The numerical value of this expense record.

date

The date at which this expense was created.

deductionAmount

The tax deduction value of this expense record.

description

The description of this expense record.

expenseId

The unique id generated by Abound API. Store this value in your database.

expenseType

The type of this expense record. Value is business or personal. This value will be automatically predicted if null.

taxCategory

The tax category of this expense record. This value will be automatically predicted if null, and the expenseType is business.


Did this page help you?