Create an Account Statement

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 Incomes and Expenses

Use POST /users/{userId}/incomes API endpoint to create incomes and POST /users/{userId}/expenses API endpoint to create expenses. Each income and expense will appear as a line item within the generated account statement.

3: Create an Account Statement

Now we can call the POST /documents API endpoint to create an Account Statement.

curl \
  --request POST \
  --url https://sandbox-api.withabound.com/v2/users/<<testUserId>>/documents \
  --header 'Authorization: Bearer <<apiKey>>' \
  --header 'Content-Type: application/json' \
  --data '{
    "documents": [
      {
        "type": "accountStatement",
        "year": 2020,
        "beginDate": "2020-01-01",
        "endDate": "2020-01-31",
        "accountNumber": "1234567890",
        "summary": {
          "beginningBalance": 5810.70,
          "endingBalance": 7230.13,
          "interestPercentage": 0.0014,
          "interestAmount": 10.12,
          "totalFees": 5
        },
        "bank": {
          "name": "Ursa Bank",
          "logo": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=",
          "address": "10 BearDen Center",
          "address2": "Suite #1",
          "city": "Kodiak",
          "state": "AK",
          "zipcode": "99615",
          "customerService": {
            "phoneNumber": "1-888-123-BEAR",
            "email": "[email protected]",
            "website": "https://fakebank.com",
            "instrucations": "Instruction text"
          }
        },
        "disclosure": "Disclosure text"
      }
    ]
  }'
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.create(
    "<<testUserId>>",
    [
      {
        type: "accountStatement",
        year: 2020,
        beginDate: "2020-01-01",
        endDate: "2020-01-31",
        accountNumber: "1234567890",
        summary: {
          beginningBalance: 5810.7,
          endingBalance: 7230.13,
          interestPercentage: 0.0014,
          interestAmount: 10.12,
          totalFees: 5,
        },
        bank: {
          name: "Ursa Bank",
          logo: "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=",
          address: "10 BearDen Center",
          address2: "Suite #1",
          city: "Kodiak",
          state: "AK",
          zipcode: "99615",
          customerService: {
            phoneNumber: "1-888-123-BEAR",
            email: "[email protected]",
            website: "https://fakebank.com",
            instructions: "Instruction text",
          },
        },
        disclosure: "Disclosure text",
      },
    ]
  );

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

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

payload = {"documents": [
        {
            "type": "accountStatement",
            "year": 2020,
            "beginDate": "2020-01-01",
            "endDate": "2020-01-31",
            "accountNumber": "1234567890",
            "summary": {
                "beginningBalance": 5810.7,
                "endingBalance": 7230.13,
                "interestPercentage": 0.0014,
                "interestAmount": 10.12,
                "totalFees": 5
            },
            "disclosure": "Disclosure Text",
            "bank": {
                "name": "Ursa Bank",
                "logo": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=",
                "address": "10 BearDen Center",
                "address2": "Suite #1",
                "city": "Kodiak",
                "state": "AK",
                "zipcode": "99615",
                "customerService": {
                    "phoneNumber": "1-888-123-BEAR",
                    "email": "[email protected]",
                    "website": "https://fakebank.com",
                    "instructions": "Instruction Text"
                }
            }
        }
    ]}
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>>";

AccountStatementDocumentBank.CustomerService customerService = AccountStatementDocumentBank.CustomerService
  .builder()
  .phoneNumber("1-888-123-BEAR")
  .email("[email protected]")
  .website("https://fakebank.com")
  .instructions("Instructions")
  .build();

AccountStatementDocumentBank bank = AccountStatementDocumentBank.builder()
  .name("Ursa Bank")
  .logo("data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=")
  .address("10 BearDen Center")
  .address2("Suite #1")
  .city("Kodiak")
  .state("AK")
  .zipcode("99615")
  .customerService(customerService)
  .build();

AccountStatementDocumentSummary summary = AccountStatementDocumentSummary.builder()
  .beginningBalance(5810.70)
  .endingBalance(7230.13)
  .interestPercentage(0.0014)
  .interestAmount(10.12)
  .totalFees(5.0)
  .build();
AccountStatementDocumentRequest accountStatementDocumentRequest = AccountStatementDocumentRequest
  .builder()
  .year(2020)
  .beginDate("2020-01-01")
  .endDate("2020-01-31")
  .accountNumber("1234567890")
  .bank(bank)
  .summary(summary)
  .disclosure("Disclosure text")
  .build();

AboundBulkResponse<Document> response = abound.documents()
  .create(userId, Collections.singletonList(accountStatementDocumentRequest));

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

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

func main() {

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

    var requestBody = []byte(`{
        "documents": [
            {
                "type": "accountStatement",
                "year": 2020,
                "beginDate": "2020-01-01",
                "endDate": "2020-01-31",
                "accountNumber": "1234567890",
                "summary": {
                    "beginningBalance": 5810.70,
                    "endingBalance": 7230.13,
                    "interestPercentage": 0.0014,
                    "interestAmount": 10.12,
                    "totalFees": 5
                },
                "bank": {
                    "name": "Ursa Bank",
                    "logo": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=",
                    "address": "10 BearDen Center",
                    "address2": "Suite #1",
                    "city": "Kodiak",
                    "state": "AK",
                    "zipcode": "99615",
                    "customerService": {
                        "phoneNumber": "1-888-123-BEAR",
                        "email": "[email protected]",
                        "website": "https://fakebank.com",
                        "instrucations": "Instruction text"
                    }
                },
                "disclosure": "Disclosure text"
            }
        ]
    }`)

    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>>/documents");
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 {
  documents = new[] {
    new {
      type = "accountStatement",
      year = 2020,
      beginDate = "2020-01-01",
      endDate = "2020-01-31",
      accountNumber = "1234567890",
      summary = new {
        beginningBalance = 5810.70,
        endingBalance = 7230.13,
        interestPercentage = 0.0014,
        interestAmount = 10.12,
        totalFees = 5
      },
      bank = new {
        name = "Ursa Bank",
        logo = "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=",
        address = "10 BearDen Center",
        address2 = "Suite #1",
        city = "Kodiak",
        state = "AK",
        zipcode = "99615",
        customerService = new {
          phoneNumber = "1-888-123-BEAR",
          email = "[email protected]",
          website = "https://fakebank.com",
          instructions = "Instruction text"
        }
      },
      disclosure = "Disclosure text"
    }
  }
});
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
require 'openssl'
require 'json'

url = URI("https://sandbox-api.withabound.com/v2/users/<<testUserId>>/documents")
requestBody = {
  documents: [
    {
      type: 'accountStatement',
      year: 2020,
      beginDate: '2020-01-01',
      endDate: '2020-01-31',
      accountNumber: '1234567890',
      summary: {
        beginningBalance: 5810.70,
        endingBalance: 7230.13,
        interestPercentage: 0.0014,
        interestAmount: 10.12,
        totalFees: 5
      },
      bank: {
        name: 'Ursa Bank',
        logo: 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjMDY2/g8AAs8BmT556WsAAAAASUVORK5CYII=',
        address: '10 BearDen Center',
        address2: 'Suite #1',
        city: 'Kodiak',
        state: 'AK',
        zipcode: '99615',
        customerService: {
          phoneNumber: '1-888-123-BEAR',
          email: '[email protected]',
          website: 'https://fakebank.com',
          instructions: 'Instruction text'
        }
      },
      disclosure: 'Disclosure text'
    }
  ]
}

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

šŸ“˜

All fields are required for Account Statements.

FieldDescription
typeThe type of document to create: accountStatement
yearThe year associated with this account statement.
beginDateThe date representing the start of this period. Follows YYYY-MM-DD format.
endDateThe date representing the end of this period. Follows YYYY-MM-DD format.
accountNumberThe ten-digit account number associated with this account statement. Numerical digits only.
summary.beginningBalanceThe balance at the beginning of the period.
summary.endingBalanceThe balance at the end of the period.
summary.interestPercentageThe annual percentage yield earned during this period.
summary.interestAmountThe dollar amount of interest earned during this period.
summary.totalFeesThe total service charges and/or fees accrued during this period.
bank.nameThe bank's name.
bank.logoThe bank's logo. (public image URL or base64 encoded image including MIME type)
bank.addressThe bank's legal street address.
bank.address2The second part of the bank's legal street address such as a suite number.
bank.cityThe bank's city, associated with the street address.
bank.stateThe two-letter character code for this bank's state. (e.g. CA for California)
bank.zipcodeThe bank's zip code, associated with the street address.
bank.customerService.phoneNumberThe bank's customer service phone number.
bank.customerService.emailThe bank's customer service email address.
bank.customerService.websiteThe bank's website address.
bank.customerService.instructionsInstruction text to include on the customer service page.
disclosureThe disclosure text to place at the bottom of all account statement pages. Maximum of one thousand (1000) characters.

4: Receive Account Statement

After your Account Statement has been created, you will receive a documentURL where you can access the generated Account Statement PDF.

{
  "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=1629919965&Signature=vDp7XgGkRJdgmVLe3P7sNuwKl0o%3D",
  "documentName": "2021-01-01 - 2021-01-31 Account Statement (7890)",
  "type": "accountStatement",
  "year": "2020",
  "createdTimestamp": 1628271669618
}

Abound documents are immutable. If you want to make changes to an Account Statement, create a new document with your changes using the POST /documents API endpoint.


Did this page help you?