cancel
Showing results for 
Search instead for 
Did you mean: 
brian-mr
New Contributor
Status: New

It would be helpful in minimizing the number of calls per customer order if the '/shipments/getrates' API method supported accepting multiple carrier codes (for example, as a comma separated list), or even a special value to return all carriers (for example, '*'). I am building an application that is attempting to find the minimum shipping cost, and if you want to find all FedEx, UPS, and USPS options for each order, it requires 3 API calls. This basically reduces the orders / minute that can be handled by a factor of 3, for an ordinary account from 40 to about 13. This is assuming you can guess which package is going to be the cheapest. If you need to check two or three packaging options, that expands a customer to require possibly upwards of 10 API calls.

 

Building the API in a smart way like this makes it feasible for a script to engage in shipping optimization (with some built in bin packing logic).

 

Thank you.

2 Comments
AirplaneFactory
First-timer

If I can piggyback on this, it would be great to find the list of what is too big or too heavy for each carrier. When I make an API call for USPS rates (via Stamps.com) for something where the WxLxH is too big, I get back an error that crashes my system. If I make an API call for UPS rates for something heavier than 150#, it throws an error. Trying to do a domestic shipment rate request for DHL also causes an error.

 

If I knew in advance what the limits were, I could avoid the errors!

brian-mr
New Contributor

FWIW, @AirplaneFactory, I gave up on this (I actually forgot that I asked this here) and built my app using the various carrier APIs directly (like UPS). As far as your issue, I would have to go back and look at what happens with the GetRates endpoint, but sending an invalid request should not really crash the whole system. You should get an API response that either tells you there is an error, or at the very least whose list of shipment options is of length 0. I would think that the weight limitations should all be defined somewhere (e.g. 150 lbs. like you say, should be defined at UPS / USPS / whoever), and your logic can handle that. You must have some sort of app / script that is making these API calls, right? So, for mine, I have all the size and weight limitations, and it only checks an option if it meets those limitations (like I said, I am now directly using carrier APIs).

 

My client has pretty light products, so I don't really have to worry about orders being heavier than the shipper can handle. If it were to happen, I think my app would fail gracefully by just not assigning a shipper, and then the warehouse would see the order unprocessed and probably figure out on their own that it was heavy and required a special option. Assuming you actually are an airplane factory, you probably have some heavy orders, so you need to probably consider what happens when an order is heavier than the heaviest standard shipping option.