ZIP-558 adds GetRatesByPostalCode function#5
Merged
ericlakich merged 1 commit intomainfrom Jan 28, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for looking up sales tax rates by US postal code through a new GetRatesByPostalCode endpoint in the v60 API, complete with validation, models, documentation, and examples.
Changes:
- Adds
GetRatesByPostalCodefunction with postal code validation and new response models (V60PostalCodeResponse,V60PostalCodeResult,V60PostalCodeAddressDetail) - Updates OpenAPI specification with the new endpoint definition and example responses
- Enhances example script to demonstrate postal code lookup usage
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ziptax/utils/validation.py | Adds validate_postal_code function to validate 5-digit or 9-digit US postal codes |
| src/ziptax/resources/functions.py | Implements GetRatesByPostalCode endpoint with validation and retry logic |
| src/ziptax/models/responses.py | Defines three new Pydantic models for postal code lookup responses |
| src/ziptax/models/init.py | Exports the new postal code response models |
| src/ziptax.egg-info/SOURCES.txt | Registers new test files for HTTP and retry modules |
| examples/basic_usage.py | Adds Example 4 demonstrating postal code lookup and renumbers subsequent examples |
| docs/spec.yaml | Adds OpenAPI specification for postal code endpoint and includes sample API response |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to support sales tax rate lookups by US postal code in the v60 API, along with the necessary models, documentation, and usage examples. It also includes some minor updates to the example script and test discovery.
New Postal Code Lookup Feature:
GetRatesByPostalCodeendpoint to the OpenAPI spec, allowing users to retrieve sales and use tax rate details using a US postal code.V60PostalCodeResponse,V60PostalCodeResult, andV60PostalCodeAddressDetailin both the OpenAPI spec and the Python models (src/ziptax/models/responses.py,src/ziptax/models/__init__.py). [1] [2] [3] [4]Usage Examples and Testing:
examples/basic_usage.pyscript to demonstrate how to use the new postal code lookup endpoint, and adjusted example numbering. [1] [2]Other Minor Updates:
These changes collectively add comprehensive support for querying tax rates by postal code, including model definitions, endpoint documentation, and usage examples, while maintaining backwards compatibility.