2 min readLogistics, Integrations, Courier software
Courier API integration: what to plan for before you connect
A practical guide to integrating courier APIs in India: booking, labels, tracking webhooks, errors and how to keep one courier's outage from stopping your business.
Connecting your order system directly to courier APIs removes a lot of manual work: no more downloading orders, uploading them to courier portals and copying AWB numbers back. But courier APIs differ widely in quality, and a careless integration can stop your dispatch when one courier has a bad day.
What a courier integration usually covers
- Serviceability check by pincode
- Shipment booking and AWB number generation
- Shipping label and manifest download
- Pickup request
- Tracking, by webhook or by polling
- Cancellation, and sometimes NDR actions and return booking
Not every courier supports every step through its API. Check the documentation and ask for sandbox access before you promise a feature to your team.
Keep each courier behind its own adapter
Your system should talk to one internal interface, such as book shipment, get label and get status. Each courier then gets its own adapter that translates to and from its API. Adding a new courier means writing a new adapter, not changing your order flow. And when one courier's API changes, only its adapter changes.
Map statuses to your own list
Couriers report status in their own words and codes, often dozens of them. Map them all to a short list your team understands. Keep the courier's original status as well, because you will need it when you raise a dispute.
Plan for failure
- Set timeouts so a slow courier API does not freeze your dispatch screen
- Retry safely: make sure a retried booking cannot create two shipments
- Queue bookings when a courier is down, and let staff switch to another courier
- Log every request and response so you can prove what was sent
- Alert someone when a courier's error rate jumps
Webhooks or polling?
Webhooks are faster and lighter, but some couriers do not offer them, and webhooks can be missed. Use webhooks where you can, and run a scheduled check for shipments that have not changed status in a while. That catches anything the webhooks missed.
Test with real shipments
Sandbox environments rarely behave exactly like production. Before going live, book a small number of real shipments through each courier and follow them to delivery, including at least one cancellation and one failed delivery.
Courier integrations are a core part of the logistics software we build. If you are connecting several couriers and want the integration to stay reliable as you grow, we can help.