Classifying Order Lines, Fees, and Shipping
Tax providers need to know what each taxable charge represents. Hantera stores that information as native classifications on the taxable base, so integrations do not need provider-specific dynamic fields.
Choose the right classification
| Base | Tax classifications | Commodity classifications | Country of origin |
|---|---|---|---|
| Order line | Yes | Yes | Yes |
| Fee | Yes | No | No |
| fulfillment shipping | Yes | No | No |
Use tax classifications to provide a provider code, such as an AvaTax code. Use commodity classifications and country of origin only for the goods on an order line. A fee and a fulfillment's freight charge are taxable, but they are not goods being imported or exported.
Tax-classification shape
Order lines, fees, and shipping all use the same nested map:
{
'avatax' -> {
'US' -> 'P0000000'
'default' -> 'P0000000'
}
}The first key identifies the tax system. The second identifies the jurisdiction; use default when the same code applies wherever no more-specific entry exists.
Use these commands according to the owner:
| Owner | Command |
|---|---|
| Order line | setOrderLineTaxClassifications |
| Fee | setFeeTaxClassifications |
| fulfillment shipping | setShippingTaxClassifications |
Replace-all writes
Each classification command replaces the complete map for its owner. Omitting an entry removes it. This makes writes deterministic, but an integration that changes one entry must preserve entries it does not own.
For example, to add a US AvaTax code while retaining an existing default code, submit both entries:
from {
effect = 'orderCommand'
type = 'setShippingTaxClassifications'
fulfillmentId = fulfillmentId
taxClassifications = {
'avatax' -> {
'US' -> 'FR020100'
'default' -> 'FR000000'
}
}
}The Graph exposes individual classification nodes for filtering and navigation. The command map is the preferred write model; node identifiers are intentionally not required to update an unchanged (system, jurisdiction) entry.
Product snapshots
Tax and commodity data normally originate in the product catalogue, but the order owns the snapshot used for its tax and audit trail. A product integration should copy the classifications onto the order line as it enriches the order. Later catalogue edits do not retroactively alter an existing order.