Create Tax Documents

There are three different types of Tax Documents you can generate at any given time:

  • 1040-ES
  • Schedule C
  • Itemized expenses

At any point, you may request the user's tax documents from a particular tax year. To do this, call the GET /users/{userId}/documents?year={year} API endpoint.

curl \
  --request GET \
  --url 'https://sandbox-api.withabound.com/v2/users/<<testUserId>>/documents?year=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.documents.list(
    "<<testUserId>>",
    {
      year: "2020",
    }
  );

  console.log(response);
})();
import requests

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

querystring = {"year":"2020"}

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

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

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>>";
String year = "2020";

DocumentParams params = DocumentParams.builder().year(year).build();
AboundBulkResponse<Document> response = abound.documents().list(userId, params);

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

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

func main() {

    url := "https://sandbox-api.withabound.com/v2/users/<<testUserId>>/documents?year=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>>/documents?year=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>>/documents?year=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

The response will be an array of document objects that contain information about the document. Your User can use the documentURL to download the document for their own record keeping.

{
  "data": [
    {
      "documentId": null,
      "documentURL": "https://tax-documents-sandbox.s3.us-west-2.amazonaws.com/test62ae93bafa6310aa9952e8b3bf5796443111/Form_1040ES_Y2020-Q2.pdf?AWSAccessKeyId=AKIA6C6AUYYBZMXK74XQ&Expires=1629919919&Signature=FzjK06DpBKpzBqRf3vYNTK%2FcwAg%3D",
      "documentName": "2020 Q2 Federal Estimated Tax Payment",
      "type": "1040ES",
      "year": "2020",
      "createdTimestamp": 1629200355886
    },
    {
      "documentId": null,
      "documentURL": "https://tax-documents-sandbox.s3.us-west-2.amazonaws.com/test62ae93bafa6310aa9952e8b3bf5796443111/2020_Expenses.csv?AWSAccessKeyId=AKIA6C6AUYYBZMXK74XQ&Expires=1629919919&Signature=stGjkFfOfnKmYWfYreaL78QD6NY%3D",
      "documentName": "2020 Expenses",
      "type": "businessExpenses",
      "year": "2020",
      "createdTimestamp": 1629200355888
    },
    {
      "documentId": null,
      "documentURL": "https://tax-documents-sandbox.s3.us-west-2.amazonaws.com/test62ae93bafa6310aa9952e8b3bf5796443111/2020_scheduleC.pdf?AWSAccessKeyId=AKIA6C6AUYYBZMXK74XQ&Expires=1629919919&Signature=NB0pAR2r6nhf9yhmsO6mQgMa1Zs%3D",
      "documentName": "2020 Schedule C",
      "type": "scheduleC",
      "year": "2020",
      "createdTimestamp": 1629200355888
    }
  ],
  "count": 4
}