Skip to content

Ledgers

Returns financial activity of an account.

Authentication Required

Requires account user level access.

query getLedgers($accountNumber: String!) {
    account(accountNumber: $accountNumber){
      ledgers{
        id
        affectsAccountBalance
        name
        balance
      }
    }
  }
1
2
3
4
5
6
# Input variables
{
    "input": {
        "accountNumber": String!,
    }
}

Examples

Get all transactions on all ledger

query getTransactionsOfLedger($accountNumber: String!) {
    account(accountNumber: $accountNumber){
      ledgers{
        id
        affectsAccountBalance
        name
        balance
        transactions(first:10){
          edges {
            node {
              amount
              postedDate
              title
            }
          }
        }
      }
    }
  }
1
2
3
4
5
6
# Input variables
{
    "input": {
        "accountNumber": "A-12345",
    }
}
{
  "data": {
    "account": {
      "ledgers": [
        {
          "id": "main",
          "affectsAccountBalance": True,
          "name": "Main ledger",
          "balance": 0,
          "transactions": {
            "edges": []
          }
        },
        {
          "id": "1",
          "affectsAccountBalance": True,
          "name": "ledger one",
          "balance": 10,
          "transactions": {
            "edges": [
              {
                "node": {
                  "amount": 105,
                  "postedDate": "2021-10-01",
                  "title": "
                }
              },
              {
                "node": {
                  "amount": 200,
                  "postedDate": "2021-09-01",
                  "title": "
                }
              },
              {
                "node": {
                  "amount": 99,
                  "postedDate": "2021-08-01",
                  "title": "No reason"
                }
              }
            ]
          }
        },
        {
          "id": "2",
          "affectsAccountBalance": True,
          "name": "ledger two",
          "balance": 10,
          "transactions": {
            "edges": [
              {
                "node": {
                  "amount": 105,
                  "postedDate": "2021-10-01",
                  "title": "
                }
              },
              {
                "node": {
                  "amount": 200,
                  "postedDate": "2021-09-01",
                  "title": "
                }
              }
            ]
          }
        }
      ]
    }
  }
}

Filter for a particular transaction type

In this example, we"re filtering for ENERGY_CHARGES.

query getTransactionsOfLedger($accountNumber: String!) {
  account(accountNumber: $accountNumber){
    ledgers{
      id
      affectsAccountBalance
      name
      balance
      transactions(first:10, transactionTypes:ENERGY_CHARGES){
        edges {
          node {
            amount
            postedDate
            title
          }
        }
      }
    }
  }
}
1
2
3
4
5
6
# Input variables
{
    "input": {
        "accountNumber": "A-12345",
    }
}
{
  "data": {
    "account": {
      "ledgers": [
        {
          "id": "main",
          "affectsAccountBalance": True,
          "name": "Main ledger",
          "balance": 10,
          "transactions": {
            "edges": [
              {
                "node": {
                  "amount": 105,
                  "postedDate": "2021-09-01",
                  "title": "Electricity"
                }
              }
            ]
          }
        }
      ]
    }
  }
}
Back to top