'Fedex API Rates and Transit Times API + LTL Freight: Account Number Invalid
I'm using the FedEx Rates and Transit Times API to get quotes for FEDEX_FREIGHT_ECONOMY
and FEDEX_FREIGHT_PRIORITY
. My project is setup as below, and my JSON request is setup as follows:
{"accountNumber":{"value":333333333},"requestedShipment":{"shipper":{"address":{"postalCode":72601,"countryCode":"US","city":"Harrison","stateOrProvinceCode":"AR"}},"recipient":{"address":{"postalCode":"11247","countryCode":"US","city":"Brooklyn","stateOrProvinceCode":"NY"}},"pickupType":"CONTACT_FEDEX_TO_SCHEDULE","serviceType":"FEDEX_FREIGHT_ECONOMY","packagingType":"YOUR_PACKAGING","rateRequestType":["LIST","ACCOUNT"],"freightShipmentDetail":{"role":"SHIPPER","fedExFreightAccountNumber":333333333,"lineItem":[{"freightClass":"CLASS_050","packaging":"CRATE","description":"MyProduct","weight":{"units":"LB","value":877},"dimensions":{"length":61.5,"width":61.5,"height":70.62,"units":"IN"}}]},"requestedPackageLineItems":[{"subPackagingType":"CRATE","weight":{"units":"LB","value":877},"dimensions":{"length":61.5,"width":61.5,"height":70.62,"units":"IN"}}]}}
However, the response I get says: 400: ACCOUNT.NUMBER.INVALID
I've also tried using: [ Shipping Account, LTL Shipper Account, LTL Bill-To Account ] in every combination in both parts of the request where an account number is needed.
Which account number is to be used where? And if the error returned isn't because of an invalid account number, but rather another request property that's omitted, which needs to be added to the request?
Thank you
Solution 1:[1]
FedEx Sandbox has problems, it is a known issue with developers that integrate with FedEx APIs. The issue you have is one of many.
To resolve the issue with FedEx Sandbox environment stability you have three options, which are essentially about using test-doubles instead of the real FedEx API:
- Create and use mocks in your code instead of using the FedEx Sandbox. For example, Mockito in Java. This means you will have to write the FedEx Mockito mocks yourself. And it comes with several tradeoffs.
- Create over-the-wire mocks with tools like Wiremock instead of using the FedEx Sandbox. There is a list of tools like that on Wikipedia. The issue here again is that you have to build those over-the-wire mocks yourself.
- Use ready-made FedEx API mocks included in ready-made Sandbox environments like the one from Traffic Parrot instead of using the FedEx Sandbox. They will be ready to use within minutes, but you have to pay for it (the current price listed is "starting at $50/month").
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |