Query tax codes for VAT/GST calculations.
GraphQL
query GetTaxCode($id: ID) {
TaxCode(id: $id) {
id
label
active
integration_pennylane { id }
tax_rates { id }
purchase_account
sales_account
}
}
GraphQL
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
}
}
}
JSON
{
"where": {
"AND": [
{ "column": "ACTIVE", "operator": "EQ", "value": true }
]
},
"orderBy": [
{ "column": "LABEL", "order": "ASC" }
],
"search": "VAT"
}
Field Type Description idInt Unique identifier of the tax code. labelString Label of the tax code. activeBoolean Whether the tax code is active. integration_pennylaneIntegration Linked accounting integration (Pennylane). tax_rates[TaxRate] Linked tax rates. purchase_accountString Purchase account code. sales_accountString Sales account code.
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 }
You can sort data based on following fields: id, label, active
GraphQL
query SortTaxCodes(
$where: QueryTaxCodesWhereWhereConditions
) {
TaxCodes(
where: $where
orderBy: [{ column: LABEL, order: ASC }]
) {
id
label
active
}
}
JSON
{
"data": {
"TaxCodes": [
{ "id": 100001, "label": "VAT 20%", "active": true },
{ "id": 100002, "label": "VAT 10%", "active": true }
]
}
}