Prompt
How do I track packages and send delivery updates from my app?
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
To track packages and send delivery updates from your app, you usually combine:
- A shipping/tracking API
- Webhook notifications
- A background job or scheduler
- Push/email/SMS notifications to users
Basic flow
- Customer places an order
- Your app creates a shipment with a carrier or shipping platform
- You store the tracking number and carrier
- Your app listens for tracking status changes
- When status changes, you notify the customer
Option 1: Use a shipping API provider
Common providers:
- AfterShip
- Shippo
- EasyPost
- Stuart / Onfleet for local delivery fleets
- Carrier APIs directly: UPS, FedEx, DHL, USPS, etc.
These services often give you:
- Tracking lookup
- Webhooks for status changes
- Carrier normalization
- Delivery ETA and event history
Typical API workflow
- Create shipment
- Receive tracking number
- Register tracking webhook
- Update your database when the carrier reports movement
Option 2: Poll carrier tracking APIs yourself
If webhooks aren’t available, you can periodically poll:
- Every 15–60 minutes for active shipments
- Less often for old shipments
Store:
- Tracking number
- Carrier
- Last known status
- Last checked time
This works, but webhooks are better because they’re more efficient and near real-time.
What to store in your database
At minimum:
order_idtracking_numbercarrierstatus(e.g.label_created,in_transit,out_for_delivery,delivered,exception)last_event_atdelivery_estimateraw_tracking_response(optional, for debugging)
Delivery updates to send
Useful update events:
- Shipment created
- Package picked up
- In transit
- Arrived at sorting facility
- Out for delivery
- Delivered
- Delivery delayed / failed attempt
- Exception / address issue
Notification channels
You can notify users via:
- Push notifications (mobile app)
- SMS
- In-app notifications
Examples:
- “Your package is out for delivery today.”
- “Your order was delivered at 3:42 PM.”
- “Delivery delayed due to weather.”
Recommended architecture
Frontend
- Order page with tracking progress UI
- Notification preferences
Backend
- Shipment creation endpoint
- Tracking webhook endpoint
- Status update service
- Notification service
Worker
- Processes tracking updates
- Sends notifications
- Deduplicates repeated events
Webhook handling example
When the shipping provider sends a webhook:
- Verify signature
- Parse tracking event
- Check if status actually changed
- Save event
- Trigger notification
Make sure to:
- Handle duplicate webhooks
- Return
200 OKquickly - Use background jobs for notification sending
Example status mapping
You’ll likely want to normalize carrier statuses into your own app statuses:
createdpicked_upin_transitout_for_deliverydeliveredexceptionreturned
Security tips
- Verify webhook signatures
- Don’t expose tracking API keys in the frontend
- Rate-limit tracking endpoints
- Log webhook payloads for debugging
If you want the simplest implementation
Use:
- AfterShip or EasyPost for tracking
- Firebase Cloud Messaging / APNs for push notifications
- Twilio for SMS
- A webhook endpoint in your backend
Example stack
- Mobile app: React Native / Flutter
- Backend: Node.js / Python / Go
- DB: PostgreSQL
- Queue: Redis / BullMQ / Celery
- Tracking: EasyPost or AfterShip
- Notifications: FCM + email/SMS
If you want, I can also give you:
- a sample database schema,
- a Node.js webhook example, or
- a full end-to-end architecture diagram.