goshippo/shippo-php-client

Issue with FedEx and retrieving the Home Delivery rate

Opened this issue · 0 comments

We are having trouble with being able to pull the Home Delivery rate from FedEx through the API.

I've spoken with Scott from general support (818446) about this issue and we believe we have identified the SDK as the issue, and I was instructed to add a ticket here.

Issue:

  • I am validating my addresses
  • I am testing with both residential and commercial addresses
  • I DO receive the proper validation in the API response (ex. the is_residential property is being set appropriately to true or false/null)
  • Even though the validator returns is_residential => true in the response, I am still seeing FedEx Ground instead of FedEx Home Delivery.

In fact, the only way I can actually get the FedEx Home Delivery rate to pull is by adding is_residential => true in the initial request BEFORE it's validated. This is problematic though because when I do this, the FedEx Home Delivery rate is displaying for both residential AND commercial addresses.

It seems to me that the validator is actually validating my address but is not adjusting the rates appropriately based on the returned results. I would be happy to provide more context if necessary.

EDIT

Alright, I actually believe I've found a solution and that is to make a separate API call to validate the address before attempting to pull the shipping rates through \Shippo_Shipment::create(...) by using Shippo_Address::create([...]).

This works and I'll move forward with this but from an API perspective, since the address validation happens during the Shipment create process, shouldn't it work for that as well? It seems a bit inefficient to require more API calls to validate the address when it's already doing it in the \Shippo_Shipment::create(...) process.