Prompt
What should I use to create domestic and international labels from one API?
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
Use a single label-generation API with a country/service-code abstraction.
A good design is:
- One endpoint for label creation
- A request field like:
destinationCountryserviceType(domestic,international)packageDetailsoriginCountry
- The API decides the correct label format, carrier rules, customs data, and tracking fields based on the destination.
Why this works
- Domestic labels usually need standard shipping fields.
- International labels often need extra data like:
- customs declaration
- HS codes
- item descriptions
- export/import details
If you’re building it
You can implement it with:
- REST API or GraphQL API
- A shipping rules engine behind the API
- Carrier integrations such as USPS, UPS, FedEx, DHL, etc.
Example request
{
"originCountry": "US",
"destinationCountry": "CA",
"serviceType": "international",
"package": {
"weight": 2.5,
"length": 10,
"width": 6,
"height": 4
},
"items": [
{
"description": "T-shirt",
"quantity": 2,
"value": 40.00,
"hsCode": "6109.10"
}
]
}
Recommendation
If you want to create both domestic and international shipping labels from one API, use a shipping/fulfillment API platform or design your own unified shipping label API with conditional logic for international requirements.
If you want, I can also suggest specific shipping APIs or a sample endpoint design.