Tax Category Service
This guide covers the `TaxCategoryService`, which is your primary tool for creating or updating tax category records through the contract-based API.
Importing Helpers
Before you start, import the necessary builders and query helpers. The `TaxCategoryService` methods rely on these to construct payloads and define query parameters.
from easy_acumatica.models.tax_category_builder import TaxCategoryBuilder
from easy_acumatica.models.query_builder import QueryOptions
Service Method
update_tax_category(api_version, builder, options=None)
Creates a new tax category or updates an existing one. The API uses a `PUT` request, which will create a new record if the `TaxCategoryID` doesn't exist, or update it if it does. You must provide a `TaxCategoryBuilder` instance containing the category's details.
# 1. Build the tax category payload
tax_category_payload = (
TaxCategoryBuilder()
.tax_category_id("SERVICES")
.description("Taxable Professional Services")
.active(True)
.exclude_listed_taxes(False)
)
# 2. Use the payload to create or update the record
try:
new_category = client.tax_categories.update_tax_category(
"24.200.001",
builder=tax_category_payload
)
print(f"Successfully created or updated tax category: {new_category['TaxCategoryID']['value']}")
except Exception as e:
print(f"Failed to process tax category: {e}")
ON THIS PAGE
Introduction
Importing Helpers
Service Method
- update_tax_category