API Queries

customCurrencies

Query Custom Currencies in the workspace

Response

Returns a CustomCurrenciesConnection!

Query
query CustomCurrencies(
  $after: String,
  $before: String,
  $first: Int,
  $last: Int
) {
  customCurrencies(
    after: $after,
    before: $before,
    first: $first,
    last: $last
  ) {
    nodes {
      ...CurrencyFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}

Variables
{"after": "abc123", "before": "abc123", "first": 2277, "last": 2277}

Response
{
  "data": {
    "customCurrencies": {
      "nodes": [Currency],
      "pageInfo": PageInfo
    }
  }
}

Arguments
Name Description
after - String Where to start paginating from, when paginating forwards. Send endCursor from a response to get its next page. Learn more about pagination .
before - String Where to start paginating from, when paginating backwards. Send startCursor from a response to get the previous page. Learn more about pagination .
first - Int The number of currencies to return per page, when paginating forwards. Defaults to 20, maximum is 200.
last - Int The number of currencies to return per page, when paginating backwards. Defaults to 20, maximum is 200.

externalAccount

Get External Account by Link and External ID or FRAGMENT ID.

Response

Returns an ExternalAccount

Query
query ExternalAccount($externalAccount: ExternalAccountMatchInput!) {
  externalAccount(externalAccount: $externalAccount) {
    currency {
      ...CurrencyFragment
    }
    currencyMode
    externalId
    id
    ledgerAccounts {
      ...LedgerAccountsConnectionFragment
    }
    link {
      ...LinkFragment
    }
    linkId
    name
    txs {
      ...TxsConnectionFragment
    }
  }
}

Variables
{"externalAccount": ExternalAccountMatchInput}

Response
{
  "data": {
    "externalAccount": {
      "currency": Currency,
      "currencyMode": "multi",
      "externalId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ledgerAccounts": LedgerAccountsConnection,
      "link": Link,
      "linkId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "name": "abc123",
      "txs": TxsConnection
    }
  }
}

Arguments
Name Description
externalAccount - ExternalAccountMatchInput!

ledger

Get a Ledger by ID

Response

Returns a Ledger

Query
query Ledger($ledger: LedgerMatchInput!) {
  ledger(ledger: $ledger) {
    balanceUTCOffset
    created
    dashboardUrl
    entryStats {
      ...LedgerEntryStatsConnectionFragment
    }
    id
    ik
    ledgerAccountDataMigrations {
      ...LedgerAccountDataMigrationConnectionFragment
    }
    ledgerAccounts {
      ...LedgerAccountsConnectionFragment
    }
    ledgerEntries {
      ...LedgerEntriesConnectionFragment
    }
    ledgerEntryDataMigrations {
      ...LedgerEntryDataMigrationConnectionFragment
    }
    ledgerEntryGroup {
      ...LedgerEntryGroupFragment
    }
    ledgerEntryGroups {
      ...LedgerEntryGroupsConnectionFragment
    }
    lines {
      ...LedgerLinesConnectionFragment
    }
    migrations {
      ...LedgerMigrationConnectionFragment
    }
    name
    schema {
      ...SchemaFragment
    }
    type
    workspaceId
  }
}

Variables
{"ledger": LedgerMatchInput}

Response
{
  "data": {
    "ledger": {
      "balanceUTCOffset": "-08:00",
      "created": "2007-12-03T10:15:30Z",
      "dashboardUrl": "abc123",
      "entryStats": LedgerEntryStatsConnection,
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "some-safe-string-ik",
      "ledgerAccountDataMigrations": LedgerAccountDataMigrationConnection,
      "ledgerAccounts": LedgerAccountsConnection,
      "ledgerEntries": LedgerEntriesConnection,
      "ledgerEntryDataMigrations": LedgerEntryDataMigrationConnection,
      "ledgerEntryGroup": LedgerEntryGroup,
      "ledgerEntryGroups": LedgerEntryGroupsConnection,
      "lines": LedgerLinesConnection,
      "migrations": LedgerMigrationConnection,
      "name": "abc123",
      "schema": Schema,
      "type": "double",
      "workspaceId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"
    }
  }
}

Arguments
Name Description
ledger - LedgerMatchInput! An object specifying the ID of the ledger you want to query

ledgerAccount

Get a Ledger Account by ID

Response

Returns a LedgerAccount

Query
query LedgerAccount($ledgerAccount: LedgerAccountMatchInput!) {
  ledgerAccount(ledgerAccount: $ledgerAccount) {
    balance
    balanceChange
    balanceChanges {
      ...CurrencyAmountConnectionFragment
    }
    balanceChangesDuring {
      ...BalanceChangeDuringConnectionFragment
    }
    balances {
      ...CurrencyAmountConnectionFragment
    }
    balancesDuring {
      ...HistoricalBalanceConnectionFragment
    }
    childBalance
    childBalanceChange
    childBalanceChanges {
      ...CurrencyAmountConnectionFragment
    }
    childBalanceChangesDuring {
      ...BalanceChangeDuringConnectionFragment
    }
    childBalances {
      ...CurrencyAmountConnectionFragment
    }
    childBalancesDuring {
      ...HistoricalBalanceConnectionFragment
    }
    childLedgerAccounts {
      ...LedgerAccountsConnectionFragment
    }
    clearingStatus
    consistencyConfig {
      ...LedgerAccountConsistencyConfigFragment
    }
    created
    currency {
      ...CurrencyFragment
    }
    currencyMode
    dashboardUrl
    id
    ik
    ledger {
      ...LedgerFragment
    }
    ledgerEntries {
      ...LedgerEntriesConnectionFragment
    }
    ledgerId
    lines {
      ...LedgerLinesConnectionFragment
    }
    link {
      ...LinkFragment
    }
    linkedAccount {
      ...ExternalAccountFragment
    }
    name
    ownBalance
    ownBalanceChange
    ownBalanceChanges {
      ...CurrencyAmountConnectionFragment
    }
    ownBalanceChangesDuring {
      ...BalanceChangeDuringConnectionFragment
    }
    ownBalances {
      ...CurrencyAmountConnectionFragment
    }
    ownBalancesDuring {
      ...HistoricalBalanceConnectionFragment
    }
    parentLedgerAccount {
      ...LedgerAccountFragment
    }
    parentLedgerAccountId
    path
    postedWindow {
      ...PostedWindowFragment
    }
    type
    unreconciledTxs {
      ...TxsConnectionFragment
    }
    workspaceId
  }
}

Variables
{"ledgerAccount": LedgerAccountMatchInput}

Response
{
  "data": {
    "ledgerAccount": {
      "balance": "999999999999",
      "balanceChange": "999999999999",
      "balanceChanges": CurrencyAmountConnection,
      "balanceChangesDuring": BalanceChangeDuringConnection,
      "balances": CurrencyAmountConnection,
      "balancesDuring": HistoricalBalanceConnection,
      "childBalance": "999999999999",
      "childBalanceChange": "999999999999",
      "childBalanceChanges": CurrencyAmountConnection,
      "childBalanceChangesDuring": BalanceChangeDuringConnection,
      "childBalances": CurrencyAmountConnection,
      "childBalancesDuring": HistoricalBalanceConnection,
      "childLedgerAccounts": LedgerAccountsConnection,
      "clearingStatus": "cleared",
      "consistencyConfig": LedgerAccountConsistencyConfig,
      "created": "2007-12-03T10:15:30Z",
      "currency": Currency,
      "currencyMode": "multi",
      "dashboardUrl": "abc123",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "abc123",
      "ledger": Ledger,
      "ledgerEntries": LedgerEntriesConnection,
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "lines": LedgerLinesConnection,
      "link": Link,
      "linkedAccount": ExternalAccount,
      "name": "abc123",
      "ownBalance": "999999999999",
      "ownBalanceChange": "999999999999",
      "ownBalanceChanges": CurrencyAmountConnection,
      "ownBalanceChangesDuring": BalanceChangeDuringConnection,
      "ownBalances": CurrencyAmountConnection,
      "ownBalancesDuring": HistoricalBalanceConnection,
      "parentLedgerAccount": LedgerAccount,
      "parentLedgerAccountId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "path": "abc123",
      "postedWindow": PostedWindow,
      "type": "asset",
      "unreconciledTxs": TxsConnection,
      "workspaceId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"
    }
  }
}

Arguments
Name Description
ledgerAccount - LedgerAccountMatchInput! An object specifying the ID of the ledger account you want to query

ledgerEntry

Get Ledger Entry by ID.

Response

Returns a LedgerEntry

Query
query LedgerEntry($ledgerEntry: LedgerEntryMatchInput!) {
  ledgerEntry(ledgerEntry: $ledgerEntry) {
    conditions {
      ...LedgerEntryConditionFragment
    }
    created
    dashboardUrl
    date
    description
    groups {
      ...LedgerEntryGroupFragment
    }
    hidden
    id
    ik
    isReversal
    isReversed
    ledger {
      ...LedgerFragment
    }
    ledgerId
    lines {
      ...LedgerLinesConnectionFragment
    }
    parameters
    posted
    reversalHistory {
      ...LedgerEntriesConnectionFragment
    }
    reversalPosition
    reversedAt
    reversedBy {
      ...LedgerEntryFragment
    }
    reverses {
      ...LedgerEntryFragment
    }
    tags {
      ...LedgerEntryTagFragment
    }
    type
    typeVersion
    workspaceId
  }
}

Variables
{"ledgerEntry": LedgerEntryMatchInput}

Response
{
  "data": {
    "ledgerEntry": {
      "conditions": [LedgerEntryCondition],
      "created": "2007-12-03T10:15:30Z",
      "dashboardUrl": "abc123",
      "date": "2022-03-28",
      "description": "abc123",
      "groups": [LedgerEntryGroup],
      "hidden": true,
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "abc123",
      "isReversal": true,
      "isReversed": true,
      "ledger": Ledger,
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "lines": LedgerLinesConnection,
      "parameters": {"bank_name": "bank-name", "deposit_amount": "10000"},
      "posted": "2007-12-03T10:15:30Z",
      "reversalHistory": LedgerEntriesConnection,
      "reversalPosition": 2277,
      "reversedAt": "2007-12-03T10:15:30Z",
      "reversedBy": LedgerEntry,
      "reverses": LedgerEntry,
      "tags": [LedgerEntryTag],
      "type": "some-safe-string-ik",
      "typeVersion": 2277,
      "workspaceId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"
    }
  }
}

Arguments
Name Description
ledgerEntry - LedgerEntryMatchInput! An object specifying the ID of the Ledger Entry you want to query.

ledgerEntryGroup

Query a Ledger Entry Group given its Ledger, key, and value.

Response

Returns a LedgerEntryGroup

Query
query LedgerEntryGroup($ledgerEntryGroup: LedgerEntryGroupMatchInput!) {
  ledgerEntryGroup(ledgerEntryGroup: $ledgerEntryGroup) {
    balances {
      ...LedgerEntryGroupBalanceConnectionFragment
    }
    created
    dashboardUrl
    key
    ledger {
      ...LedgerFragment
    }
    ledgerEntries {
      ...LedgerEntriesConnectionFragment
    }
    ledgerId
    value
  }
}

Variables
{"ledgerEntryGroup": LedgerEntryGroupMatchInput}

Response
{
  "data": {
    "ledgerEntryGroup": {
      "balances": LedgerEntryGroupBalanceConnection,
      "created": "2007-12-03T10:15:30Z",
      "dashboardUrl": "abc123",
      "key": "some-safe-string-ik",
      "ledger": Ledger,
      "ledgerEntries": LedgerEntriesConnection,
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "value": "some-safe-string-ik"
    }
  }
}

Arguments
Name Description
ledgerEntryGroup - LedgerEntryGroupMatchInput!

ledgerEntryHistory

Get the reversal history of a Ledger Entry.

Response

Returns a LedgerEntriesConnection!

Query
query LedgerEntryHistory($ledgerEntry: LedgerEntryMatchInput!) {
  ledgerEntryHistory(ledgerEntry: $ledgerEntry) {
    nodes {
      ...LedgerEntryFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}

Variables
{"ledgerEntry": LedgerEntryMatchInput}

Response
{
  "data": {
    "ledgerEntryHistory": {
      "nodes": [LedgerEntry],
      "pageInfo": PageInfo
    }
  }
}

Arguments
Name Description
ledgerEntry - LedgerEntryMatchInput! An object specifying the ID or IK of the Ledger Entry's reversal history to query.

ledgerLine

Get LedgerLine by ID

Response

Returns a LedgerLine

Query
query LedgerLine($ledgerLine: LedgerLineMatchInput!) {
  ledgerLine(ledgerLine: $ledgerLine) {
    account {
      ...LedgerAccountFragment
    }
    accountId
    amount
    created
    currency {
      ...CurrencyFragment
    }
    date
    description
    externalTransferId
    externalTransferType
    externalTxId
    hidden
    id
    isReversal
    isReversed
    key
    ledger {
      ...LedgerFragment
    }
    ledgerEntry {
      ...LedgerEntryFragment
    }
    ledgerEntryId
    ledgerId
    otherTxExternalAccountExternalId
    otherTxExternalAccountId
    otherTxExternalId
    otherTxId
    posted
    reversedAt
    reversedBy {
      ...LedgerLineFragment
    }
    reverses {
      ...LedgerLineFragment
    }
    tags {
      ...LedgerLineTagFragment
    }
    tx {
      ...TxFragment
    }
    txId
    type
    workspaceId
  }
}

Variables
{"ledgerLine": LedgerLineMatchInput}

Response
{
  "data": {
    "ledgerLine": {
      "account": LedgerAccount,
      "accountId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "amount": "999999999999",
      "created": "2007-12-03T10:15:30Z",
      "currency": Currency,
      "date": "2022-03-28",
      "description": "abc123",
      "externalTransferId": "abc123",
      "externalTransferType": "ach",
      "externalTxId": "abc123",
      "hidden": true,
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "isReversal": true,
      "isReversed": true,
      "key": "abc123",
      "ledger": Ledger,
      "ledgerEntry": LedgerEntry,
      "ledgerEntryId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "otherTxExternalAccountExternalId": "abc123",
      "otherTxExternalAccountId": "abc123",
      "otherTxExternalId": "abc123",
      "otherTxId": "abc123",
      "posted": "2007-12-03T10:15:30Z",
      "reversedAt": "2007-12-03T10:15:30Z",
      "reversedBy": LedgerLine,
      "reverses": LedgerLine,
      "tags": [LedgerLineTag],
      "tx": Tx,
      "txId": "abc123",
      "type": "credit",
      "workspaceId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"
    }
  }
}

Arguments
Name Description
ledgerLine - LedgerLineMatchInput! An object specifying the ID of the LedgerLine you want to query

ledgers

Query Ledgers in workspace. Ledgers are paginated and returned in reverse-chronological order by their created date.

Response

Returns a LedgersConnection!

Query
query Ledgers(
  $after: String,
  $before: String,
  $filter: LedgersFilterSet,
  $first: Int,
  $last: Int
) {
  ledgers(
    after: $after,
    before: $before,
    filter: $filter,
    first: $first,
    last: $last
  ) {
    nodes {
      ...LedgerFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}

Variables
{
  "after": "abc123",
  "before": "abc123",
  "filter": LedgersFilterSet,
  "first": 2277,
  "last": 2277
}

Response
{
  "data": {
    "ledgers": {
      "nodes": [Ledger],
      "pageInfo": PageInfo
    }
  }
}

Arguments
Name Description
after - String Where to start paginating from, when paginating forwards. Send endCursor from a response to get its next page. Learn more about pagination .
before - String Where to start paginating from, when paginating backwards. Send startCursor from a response to get the previous page. Learn more about pagination .
filter - LedgersFilterSet Filter the Ledgers returned. Learn more about querying Ledgers .
first - Int The number of Ledgers to return per page, when paginating forwards. Defaults to 20, maximum is 200.
last - Int The number of Ledgers to return per page, when paginating backwards. Defaults to 20, maximum is 200.

schema

Get a Schema by key.

Response

Returns a Schema

Query
query Schema($schema: SchemaMatchInput!) {
  schema(schema: $schema) {
    key
    ledgers {
      ...LedgersConnectionFragment
    }
    name
    version {
      ...SchemaVersionFragment
    }
    versions {
      ...SchemaVersionConnectionFragment
    }
  }
}

Variables
{"schema": SchemaMatchInput}

Response
{
  "data": {
    "schema": {
      "key": "some-safe-string-ik",
      "ledgers": LedgersConnection,
      "name": "abc123",
      "version": SchemaVersion,
      "versions": SchemaVersionConnection
    }
  }
}

Arguments
Name Description
schema - SchemaMatchInput! This contains the key of the Schema you want to retrieve.

schemas

Retrieve all of the Schemas in the workspace.

Response

Returns a SchemaConnection!

Query
query Schemas(
  $after: String,
  $before: String,
  $first: Int,
  $last: Int
) {
  schemas(
    after: $after,
    before: $before,
    first: $first,
    last: $last
  ) {
    nodes {
      ...SchemaFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}

Variables
{"after": "abc123", "before": "abc123", "first": 2277, "last": 2277}

Response
{
  "data": {
    "schemas": {
      "nodes": [Schema],
      "pageInfo": PageInfo
    }
  }
}

Arguments
Name Description
after - String Where to start paginating from, when paginating forwards. Send endCursor from a response to get its next page. Learn more about pagination .
before - String Where to start paginating from, when paginating backwards. Send startCursor from a response to get the previous page. Learn more about pagination .
first - Int The number of schemas to return per page, when paginating forwards. Defaults to 20, maximum is 200.
last - Int The number of schemas to return per page, when paginating backwards. Defaults to 20, maximum is 200.

tx

Get a Tx by ID

Response

Returns a Tx

Query
query Tx($tx: TxMatchInput!) {
  tx(tx: $tx) {
    accountId
    amount
    currency {
      ...CurrencyFragment
    }
    date
    deletedAt
    description
    externalAccount {
      ...ExternalAccountFragment
    }
    externalAccountId
    externalId
    id
    isDeleted
    ledgerEntries {
      ...LedgerEntriesConnectionFragment
    }
    ledgerEntryIds
    ledgerLineIds
    ledgerLines {
      ...LedgerLinesConnectionFragment
    }
    link {
      ...LinkFragment
    }
    linkId
    posted
    sequence
    workspaceId
  }
}

Variables
{"tx": TxMatchInput}

Response
{
  "data": {
    "tx": {
      "accountId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "amount": "999999999999",
      "currency": Currency,
      "date": "2022-03-28",
      "deletedAt": "2007-12-03T10:15:30Z",
      "description": "abc123",
      "externalAccount": ExternalAccount,
      "externalAccountId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "externalId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "isDeleted": true,
      "ledgerEntries": LedgerEntriesConnection,
      "ledgerEntryIds": ["3116551f-5efc-4c9e-84ac-5a36a51b09c1"],
      "ledgerLineIds": ["3116551f-5efc-4c9e-84ac-5a36a51b09c1"],
      "ledgerLines": LedgerLinesConnection,
      "link": Link,
      "linkId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "posted": "2007-12-03T10:15:30Z",
      "sequence": 2277,
      "workspaceId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"
    }
  }
}

Arguments
Name Description
tx - TxMatchInput! The transaction you're querying. You can specify either: * The FRAGMENT ID of the transaction (id) * The external system's transaction ID (externalId) and FRAGMENT ID of the external account (accountId) * The external system's transaction ID (externalId), the external system's account ID (externalAccountId) and FRAGMENT ID of the Link (linkId)

workspace

Get the current Workspace

Response

Returns a Workspace!

Query
query Workspace {
  workspace {
    id
    name
  }
}


Response
{"data": {"workspace": {"id": "abc123", "name": "abc123"}}}

Arguments