- Client Libraries
- First Shipment
- Test Mode
- Carrier Accounts
- Address Validation
- International Shipments
- Track Shipments
- Single Call Label Creation
- Multi-Piece Shipment
- Batch Label Creation
- Shipping on Stripe
Asynchronous API Response Handling
By default, the Shippo API returns rates and labels asynchronously.
asyncparameter in the POST body to
What are asynchronous responses?
Asynchronous responses mean that Shippo won't be returning rates or label you have requested immediately. After your Rates or Label API POST call, you will get a successful response from the Shippo API, but without the actual rates or label. This allows your implementation to do other tasks while Shippo is retrieving your data.
Here's a sample schema for how asynchronous API responses work, in this case for Rate requests:
When does it make sense to use asynchronous responses?
It takes time for Shippo to call upstream API(s), such as the USPS or FedEx API, to retrieve rates and/or label. By using asynchronous responses, your rates or label requests won't block the rest of your code, and you can proceed with other tasks in the meantime.
The best way to handle asynchronous API responses is to access the corresponding API resource (Rate or Transaction) one or multiple times after object creation. As soon as a carrier has returned a rate or label, it will be accessible in the corresponding Shippo API resource.