B 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
    id
    ik
    ledgerAccounts {
      ...LedgerAccountsConnectionFragment
    }
    ledgerEntries {
      ...LedgerEntriesConnectionFragment
    }
    ledgerEntryGroup {
      ...LedgerEntryGroupFragment
    }
    ledgerEntryGroups {
      ...LedgerEntryGroupsConnectionFragment
    }
    migrations {
      ...LedgerMigrationConnectionFragment
    }
    name
    schema {
      ...SchemaFragment
    }
    type
    workspaceId
  }
}

Variables
{"ledger": LedgerMatchInput}

Response
{
  "data": {
    "ledger": {
      "balanceUTCOffset": "-08:00",
      "created": "2007-12-03T10:15:30Z",
      "dashboardUrl": "abc123",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "some-safe-string-ik",
      "ledgerAccounts": LedgerAccountsConnection,
      "ledgerEntries": LedgerEntriesConnection,
      "ledgerEntryGroup": LedgerEntryGroup,
      "ledgerEntryGroups": LedgerEntryGroupsConnection,
      "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
    }
    balances {
      ...CurrencyAmountConnectionFragment
    }
    childBalance
    childBalanceChange
    childBalanceChanges {
      ...CurrencyAmountConnectionFragment
    }
    childBalances {
      ...CurrencyAmountConnectionFragment
    }
    childLedgerAccounts {
      ...LedgerAccountsConnectionFragment
    }
    consistencyConfig {
      ...LedgerAccountConsistencyConfigFragment
    }
    created
    currency {
      ...CurrencyFragment
    }
    currencyMode
    dashboardUrl
    id
    ik
    ledger {
      ...LedgerFragment
    }
    ledgerId
    lines {
      ...LedgerLinesConnectionFragment
    }
    link {
      ...LinkFragment
    }
    linkedAccount {
      ...ExternalAccountFragment
    }
    name
    ownBalance
    ownBalanceChange
    ownBalanceChanges {
      ...CurrencyAmountConnectionFragment
    }
    ownBalances {
      ...CurrencyAmountConnectionFragment
    }
    parentLedgerAccount {
      ...LedgerAccountFragment
    }
    parentLedgerAccountId
    path
    type
    unreconciledTxs {
      ...TxsConnectionFragment
    }
    workspaceId
  }
}

Variables
{"ledgerAccount": LedgerAccountMatchInput}

Response
{
  "data": {
    "ledgerAccount": {
      "balance": "999999999999",
      "balanceChange": "999999999999",
      "balanceChanges": CurrencyAmountConnection,
      "balances": CurrencyAmountConnection,
      "childBalance": "999999999999",
      "childBalanceChange": "999999999999",
      "childBalanceChanges": CurrencyAmountConnection,
      "childBalances": CurrencyAmountConnection,
      "childLedgerAccounts": LedgerAccountsConnection,
      "consistencyConfig": LedgerAccountConsistencyConfig,
      "created": "2007-12-03T10:15:30Z",
      "currency": Currency,
      "currencyMode": "multi",
      "dashboardUrl": "abc123",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "abc123",
      "ledger": Ledger,
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "lines": LedgerLinesConnection,
      "link": Link,
      "linkedAccount": ExternalAccount,
      "name": "abc123",
      "ownBalance": "999999999999",
      "ownBalanceChange": "999999999999",
      "ownBalanceChanges": CurrencyAmountConnection,
      "ownBalances": CurrencyAmountConnection,
      "parentLedgerAccount": LedgerAccount,
      "parentLedgerAccountId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "path": "abc123",
      "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
    }
    id
    ik
    ledger {
      ...LedgerFragment
    }
    ledgerId
    lines {
      ...LedgerLinesConnectionFragment
    }
    parameters
    posted
    tags {
      ...LedgerEntryTagFragment
    }
    type
    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],
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "ik": "abc123",
      "ledger": Ledger,
      "ledgerId": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "lines": LedgerLinesConnection,
      "parameters": {"bank_name": "bank-name", "deposit_amount": "10000"},
      "posted": "2007-12-03T10:15:30Z",
      "tags": [LedgerEntryTag],
      "type": "some-safe-string-ik",
      "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!

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
    id
    key
    ledger {
      ...LedgerFragment
    }
    ledgerEntry {
      ...LedgerEntryFragment
    }
    ledgerEntryId
    ledgerId
    otherTxExternalAccountExternalId
    otherTxExternalAccountId
    otherTxExternalId
    otherTxId
    posted
    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",
      "id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1",
      "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",
      "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