Prompt
Do I need shipping rules in code or can the carrier API handle them?
Latest observation
Nov 9, 2026
OpenAI APIWeb search: off
Usually, you need some shipping logic in your code, and you can use the carrier API for rate quotes and labels.
What the carrier API typically handles
Carrier APIs are good for:
- Live rate quotes
- Label generation
- Tracking
- Address validation
- Service availability
What your app usually needs to handle
Your code usually needs to decide:
- Which shipping methods you offer
- When a method is allowed
- Free shipping thresholds
- Weight/dimension rules
- Product restrictions
- Region/country restrictions
- Split shipments or fulfillment rules
- Which carrier/service to use when multiple are available
Why
Carrier APIs generally don’t know your business rules. They can tell you:
- “This address can be shipped to”
- “This service costs $X”
But they usually won’t decide:
- “Offer free shipping over $50”
- “Don’t ship hazardous items by air”
- “Use expedited for perishables”
- “Hide economy shipping for oversized items”
Common pattern
A good setup is:
- Your code determines eligible shipping options
- Carrier API returns rates for those options
- Your code applies business rules and picks/filters the final methods
- Carrier API creates the label for the chosen service
When carrier API alone might be enough
If your shipping is very simple and you only need:
- Basic live rates
- Basic label generation
- No special business rules
then the carrier API may cover most of it.
Practical recommendation
For most real stores, put business rules in code/config, and use the carrier API for:
- quotes
- shipping labels
- tracking
If you want, I can sketch a simple architecture for shipping rules vs carrier API, or show an example rules engine.
Brands