State codes and filing

The codes a return asks for, and who it goes to.

State codes

Each part's ids repeats what the state's rate data says about that tax: its codes, and who collects it. The whole location's codes are in locationIds. Keys are the publisher's own column names and values are exactly as published, leading zeros and all; we don't check them against a return's code list. Census FIPS codes are in code, never in ids. locationIds is {} when the address could be in areas whose ids differ.

To find the location's filing code without knowing the state, read locationIds[reporting.locationKey]. Read a code by its exact key, and treat every key as possibly absent: fall back to your own lookup rather than guess when it's missing. Keep values as strings. locationCode is OpenTaxRate's own key, not a filing code. The OpenAPI spec names each locationIds key below, so a generated client has them as optional fields.

"parts": [
  { "kind": "state", "name": "Alabama", "code": "45:01", "rate": 0.04, "ids": {} },
  { "kind": "county", "name": "MONTGOMERY COUNTY", "code": "00:101", "rate": 0.025,
    "ids": { "Locality Code": "7051", "County Number": "51", "Administered": "SELF" } },
  { "kind": "city", "name": "MONTGOMERY", "code": "01:51000", "rate": 0.035,
    "ids": { "Locality Code": "9454", "County Number": "51", "Administered": "SELF" } }
]
StateKeys in ids
AlabamaLocality Code, County Number, Administered (STATE, SELF or a private collector). A county rate made of several codes lists each, comma-separated.
TexasTAID; CMPTRL_CNTY_NBR and FIPS_ST_CNTY_CD for counties, Transit_Type, SPD_Type
IllinoisLocation Code with its check digit (048-0002-8), County Name
LouisianaDomicile Code, Parish, Parish Code
ArizonaRegionCode, and County or FIPS
New Mexicolocat_cdr, locat_cd1, locat_cd2
Colorado, AlaskaplaceId, placeTypeId (the state lookup's own ids)
MissouriJurisdiction Code, District Code 1 to 5; the location's Jurisdiction Code is also in locationIds
CaliforniaNone on parts; the location's Tax Area Code (CDTFA's 12 characters, 19034D900000) and Local Tax Area Code (its first five digits, 19034: county and city, 998 unincorporated, as CDTFA-531-FL1 lists them for a return's schedules) in locationIds. No district tax codes yet.
Streamlined statesNone on parts; the location's Composite SER Code in locationIds where the state fills it (zero-padded in Washington: 01726; Washington also gets the DOR's four-digit Location Code, 1726, the code My DOR files under)
Everywhere elseNone yet: {}

Reporting

reporting says where the tax is filed.

FieldDescription
agencyThe state agency the return goes to, and its sales tax page.
formThe return most sellers file there.
notesFiling that doesn't go through the state: cities that collect their own tax, a separate program for remote sellers.
locationKeyThe locationIds key the return files the location under: Location Code in Washington, Local Tax Area Code in California, Jurisdiction Code in Missouri; null elsewhere.