FedEx Freight Rates API for Shipping is one of the most complex freight rates APIs but a reliable and affordable solution as compared to others available on the market. In comparison to “Simple Rates”, Freight Rates API has less support available on Google and other support forums which makes it a bit hard to get proper help/support when one is stuck with any problem.
Our resource of vteam #401 was facing problem in getting freight rates. He created several support tickets on FedEx forum, but failed to get any proper response. He observed errors on each request he was creating. Initially, he thought it happened because Freight service is not validated from FedEx and that is why he was facing issues repeatedly. He used all the information received in every possible way in his code for calling the API but the transaction was returning the following error:
Message: The account number entered for FEDEX_FREIGHT could not be validated. LocalizedMessage: The account number entered for FEDEX_FREIGHT could not be validated.
In order to fix the problem, developer did some R&D. He read FedEx documentation and performed a step by step analysis on the code as well. When he signed up for “FedEx API”, they sent him the key and meter number for using these credentials with the API. Live account details were also provided to him by the client. He tried everything but no didn’t succeed.
Two common mistakes were identified in the following code after R&D:
if($var == 'key') Return 'Ktz78Vwm8O7xrqoL'; // My FedEx key if($var == 'password') Return 'yjlxWFFXzLmTKCdEd3rG4clzQ'; // FedEx password received in EMAIL if($var == 'shipaccount') Return '510087607'; // Account Number [Either Test or Live]
Normally ‘shipaccount’ is confused with FedEx Freight LTL Shipper Account Number due to the name similarity between them, but in actual ‘shipaccount’ is the test or live account number.
if($var == 'freightaccount') Return '510087020'; // FedEx Freight LTL Shipper Account Number
Generally it is confused with the test or live account number instead of Shipper Account Number.
if($var == 'locationid') Return 'PLBA'; if($var == 'printlabels') Return false; if($var == 'printdocuments') Return true; if($var == 'packagecount') Return '4'; if($var == 'meter') Return '118616750'; // Meter number
Following two points should be noted:
1.‘shipaccount’ is not the Shipper Account Number but it is either Test or Live FedEx freight account Number
2.‘freightaccount’ is not the Test or Live FedEx freight account Number but it is the FedEx Freight LTL Shipper Account Number
The developer was doing the mistake due to this confusion in the names and keywords. This is quite a common issue that every developer may encounter but no specific help is available online for this particular scenario. Our resource learned the solution from hit and trial. This solution will be beneficial for every developer out there committing the same common mistake repeatedly.