Accounting Families Queries

Access accounting families for ledger classification.

AccountingFamily — Returns a single accounting family based on the id provided

query GetAccountingFamily($id: ID) {
  AccountingFamily(id: $id) {
    id
    label
    sales_label
    purchases_label
    default
  }
}
{
  "id": 100012
}

AccountingFamilies — Returns a list of accounting families with ordering, filters, and search

query AccountingFamilies(
  $where: QueryAccountingFamiliesWhereWhereConditions,
  $orderBy: [QueryAccountingFamiliesOrderByOrderByClause!],
  $search: String
) {
  AccountingFamilies(
    where: $where
    orderBy: $orderBy
    search: $search
  ) {
    id
    label
    sales_label
    purchases_label
    default
  }
}
{
  "where": {
    "AND": [
      { "column": "DEFAULT", "operator": "EQ", "value": true }
    ]
  },
  "orderBy": [
    { "column": "LABEL", "order": "ASC" }
  ],
  "search": "family name"
}

Available fields

FieldTypeDescription
idIntUnique identifier of the accounting family.
labelStringLabel of the accounting family.
sales_labelStringSales label for the accounting family.
purchases_labelStringPurchases label for the accounting family.
defaultBooleanWhether this is the default accounting family.

Filters

You can create filters based on following fields

id - Int
Example: { "column": "ID", "operator": "EQ", "value": 100012 }
label - String
Example: { "column": "LABEL", "operator": "LIKE", "value": "%family%" }
default - Boolean
Example: { "column": "DEFAULT", "operator": "EQ", "value": true }
company_id - ID
Example: { "column": "COMPANY_ID", "operator": "EQ", "value": 100001 }
deleted_at - DateTime
Example: { "column": "DELETED_AT", "operator": "NULL", "value": true }
hard_deleted_at - DateTime
Example: { "column": "HARD_DELETED_AT", "operator": "NULL", "value": true }

Sorting

You can sort data based on following fields: id, label, default

query SortAccountingFamilies(
  $where: QueryAccountingFamiliesWhereWhereConditions
) {
  AccountingFamilies(
    where: $where
    orderBy: [{ column: LABEL, order: ASC }]
  ) {
    id
    label
    sales_label
    purchases_label
    default
  }
}

Example of data returned

{
  "data": {
    "AccountingFamilies": [
      {
        "id": 100001,
        "label": "Products",
        "sales_label": "Product Sales",
        "purchases_label": "Product Purchases",
        "default": true
      },
      {
        "id": 100002,
        "label": "Services",
        "sales_label": "Service Sales",
        "purchases_label": "Service Purchases",
        "default": false
      }
    ]
  }
}