Skip to content

Comments

ZIP-558 adds GetRatesByPostalCode function#5

Merged
ericlakich merged 1 commit intomainfrom
ZIP-558/postal-function
Jan 28, 2026
Merged

ZIP-558 adds GetRatesByPostalCode function#5
ericlakich merged 1 commit intomainfrom
ZIP-558/postal-function

Conversation

@ericlakich
Copy link
Contributor

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:

  • Added the GetRatesByPostalCode endpoint to the OpenAPI spec, allowing users to retrieve sales and use tax rate details using a US postal code.
  • Defined new response models for postal code lookups: V60PostalCodeResponse, V60PostalCodeResult, and V60PostalCodeAddressDetail in both the OpenAPI spec and the Python models (src/ziptax/models/responses.py, src/ziptax/models/__init__.py). [1] [2] [3] [4]
  • Added input validation for postal codes in the request logic.
  • Updated the API response examples in the documentation to include a sample response for the new postal code lookup endpoint.

Usage Examples and Testing:

  • Expanded the examples/basic_usage.py script to demonstrate how to use the new postal code lookup endpoint, and adjusted example numbering. [1] [2]
  • Registered new tests for HTTP and retry logic in the test discovery file.

Other Minor Updates:

  • Minor formatting improvements in the example script for better readability.
  • Updated imports in the resource functions to include the new models.

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.

Copilot AI review requested due to automatic review settings January 28, 2026 20:41
@linear
Copy link

linear bot commented Jan 28, 2026

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetRatesByPostalCode function 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.

@ericlakich ericlakich merged commit 1e001f5 into main Jan 28, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant