Tax Codes Queries

Query tax codes for VAT/GST calculations.

TaxCode — Returns a single tax code based on the id provided

query GetTaxCode($id: ID) {
  TaxCode(id: $id) {
    id
    label
    active
    integration_pennylane { id }
    tax_rates { id }
    purchase_account
    sales_account
  }
}
{
  "id": 100012
}

TaxCodes — Returns a list of tax codes with ordering, filters, and search

query TaxCodes(
  $where: QueryTaxCodesWhereWhereConditions,
  $orderBy: [QueryTaxCodesOrderByOrderByClause!],
  $search: String
) {
  TaxCodes(
    where: $where
    orderBy: $orderBy
    search: $search
  ) {
    paginatorInfo {
      total
      count
      currentPage
      perPage
    }
    data {
      id
      label
      active
      purchase_account
      sales_account
    }
  }
}
{
  "where": {
    "AND": [
      { "column": "ACTIVE", "operator": "EQ", "value": true }
    ]
  },
  "orderBy": [
    { "column": "LABEL", "order": "ASC" }
  ],
  "search": "VAT"
}

Available fields

FieldTypeDescription
idIntUnique identifier of the tax code.
labelStringLabel of the tax code.
activeBooleanWhether the tax code is active.
integration_pennylaneIntegrationLinked accounting integration (Pennylane).
tax_rates[TaxRate]Linked tax rates.
purchase_accountStringPurchase account code.
sales_accountStringSales account code.

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": "%VAT%" }
active - Boolean
Example: { "column": "ACTIVE", "operator": "EQ", "value": true }
company_id - ID
Example: { "column": "COMPANY_ID", "operator": "EQ", "value": 100001 }

Sorting

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

query SortTaxCodes(
  $where: QueryTaxCodesWhereWhereConditions
) {
  TaxCodes(
    where: $where
    orderBy: [{ column: LABEL, order: ASC }]
  ) {
    id
    label
    active
  }
}

Example of data returned

{
  "data": {
    "TaxCodes": [
      { "id": 100001, "label": "VAT 20%", "active": true },
      { "id": 100002, "label": "VAT 10%", "active": true }
    ]
  }
}