Downloading Tax Documents

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.*;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/documents?year=2020")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer <<apiKey>>")
  .build();

Response response = client.newCall(request).execute();
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 tax document objects that contain information about the document. Your UserUser - A single end-user of your application. Each user has a unique userId, which should be stored in your database and used to make API requests on behalf of this individual. can use the documentURL to download the tax document for their own record keeping.

{
  "data": [
    {
      "documentId": "documentId_testefbd5d3d9ee9526ef9ff89a7c6b879174170",
      "documentURL": "https://tax-documents-sandbox.s3.us-west-2.amazonaws.com/test62ae93bafa6310aa9952e8b3bf5796443111/2020-01-01_2020-01-31_Account_Statement_7890.pdf?AWSAccessKeyId=AKIA6C6AUYYBZMXK74XQ&Expires=1629919919&Signature=Vs0LRkA%2BlWBCBp0OWDs%2FDNXzoEY%3D",
      "documentName": "2020-01-01 - 2020-01-31 Account Statement (7890)",
      "type": "accountStatement",
      "year": "2020",
      "createdTimestamp": 1629200355784
    },
    {
      "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
}

Field

Description

documentId

The identifier for this PDF document.

documentURL

The URL of the downloadable PDF document.

documentName

The file name of this PDF document.

type

The type of this document. (1040ES, accountStatement, scheduleC or businessExpenses)

year

The calendar year that this document is associated with.

createdTimestamp

The timestamp at which this document was created.


Did this page help you?