46

I'm configuring FEDEX shipping in Magento website. I got test account number, password, API key and meter number by login in test FEDEX account. I configured myself in Magento. Looks like everything fine. But I don't know how to test is Track Order.

So where can I get tracking number for shipping methods? Should I enter randomly or how can I get that? I tried some forum suggested numbers. But I got below error in my popup:

Tracking information is currently not available

I also checked my shipping_fedex log file in Magento. got logged some error codes in printed array. That's I give in below.

**ERROR log**

[result] => stdClass Object (
[HighestSeverity] => ERROR
[Notifications] => stdClass Object (
[Severity] => ERROR
[Source] => trck
[Code] => 6035
[Message] => Invalid tracking numbers. Please check the following numbers and resubmit.
[LocalizedMessage] => Invalid tracking numbers. Please check the following numbers and resubmit.
)
[Version] => stdClass Object (
[ServiceId] => trck
[Major] => 5
[Intermediate] => 0
[Minor] => 0
)
)

FEDEX help:

What Numbers Can I Track?

Track by Tracking Number: You can enter up to 30 tracking numbers at a time. You can enter any combination of FedEx Express, FedEx Express Freight, FedEx Ground, FedEx SmartPost, FedEx Freight, or FedEx Custom Critical tracking numbers. Please ensure that you enter only one tracking number per line.

Edit: I used "99999999999" as per Derek suggestion. But I got below response. Still same error in pop up. What does mean __pid =>2432?

Array
(
    [request] => <?xml version="1.0" encoding="UTF-8"?>
<FDXTrack2Request xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="FDXTrack2Request.xsd"><RequestHeader><AccountNumber>510087062</AccountNumber><MeterNumber>0</MeterNumber></RequestHeader><PackageIdentifier><Value>999999999999</Value></PackageIdentifier><DetailScans>1</DetailScans></FDXTrack2Request>

    [result] => 
    [__pid] => 2432
)
halfer
  • 19,824
  • 17
  • 99
  • 186
Gowri
  • 16,587
  • 26
  • 100
  • 160

9 Answers9

57

Your question is not at all stupid. I upvoted it.

The fedex documentation is horrible and doesn't mention how to use their services while testing and after moving to production. Their support is worse.

While I was rambling in the internet, I found a page mentioning the tracking number 123456789012 as a test number. Use it with your test credentials (key, password, account number and meter number), while you're setting your service path to https://wsbeta.fedex.com:443/web-services/track, and the request will return a valid response that you can build on.

Munawir
  • 3,346
  • 9
  • 33
  • 51
Ashraf Sabry
  • 3,081
  • 3
  • 32
  • 29
  • I am using testing url and creadential for tracking fedex shipment(on testing environment) but it does not return when I track shipment while it says tracking number not found but in fedex website when I track those numbers then it display result. I don't know why it is behaving like this way. Anyone have answers about it? – Awadhendra Jan 13 '15 at 08:29
  • @Awadhendra I'm sorry. My experience with using this messy API is old. I've just developed on it only once 3 years ago (see the answer date). But I remember that the behaviour you describe happened to me, and it's the correct behaviour. My employer back then sent me a couple of tracking numbers of real messages whom my application didn't recognize. This is because the testing service is isolated from accessing real messages. You can only use the dummy number 123456789012 while testing. When you're done with development, change the URL to that of production and everything will work. – Ashraf Sabry Jan 15 '15 at 06:19
  • @Awadhendra This behaviour must be described somewhere but I can't remember. Back then I told my employer to not use real tracking numbers while testing and just use the dummy number. After I finished the work, I changed the service URL to the production URL, and the application worked for real numbers and he accepted the work without complaints. You will have some hard times with this API because their documentation is bad and their support is worse (at least they were so 3 years ago). – Ashraf Sabry Jan 15 '15 at 06:24
  • Thanks for your reply. Actually behaviour which I got that is because I hard-coded a perticular carrier service in request xml and tracking number which I am using that does not belongs to that tracking number. I am not able to solve out that issue in version 9 API of fedex service but I am able to solve it in fedex version 6 api. Thanks. – Awadhendra Jan 15 '15 at 07:12
  • while tracking I am getting Fedex::RateError: Fedex::RateError fedex.track(:tracking_number => "123456789012 ") Please suggest – yaswant singh Nov 23 '16 at 08:08
  • @yaswantsingh Hmmm…not sure. Maybe they changed their policy? From the error name it seems that they pose some usage limit on API usage. Try to contact their support. They replied to me back then, although they replied too late after I managed to resolve the issue! – Ashraf Sabry Nov 24 '16 at 05:17
51

Here’s a list of static tracking numbers that can be used in the FedEx test environment:

449044304137821 = Shipment information sent to FedEx
149331877648230 = Tendered
020207021381215 = Picked Up
403934084723025 = Arrived at FedEx location
920241085725456 = At local FedEx facility
568838414941 = At destination sort facility
039813852990618 = Departed FedEx location
231300687629630 = On FedEx vehicle for delivery
797806677146 = International shipment release
377101283611590 = Customer not available or business closed
852426136339213 = Local Delivery Restriction
797615467620 = Incorrect Address
957794015041323 = Unable to Deliver
076288115212522 = Returned to Sender/Shipper
581190049992 = International Clearance delay
122816215025810 = Delivered
843119172384577 = Hold at Location
070358180009382 = Shipment Canceled
Anonymous
  • 581
  • 5
  • 2
  • These tracking numbers not working with testing URL or testing creadentials. – Awadhendra Jan 13 '15 at 08:26
  • Thank you. For the record, these tracking numbers do work fine with the testing URL. This can easily be verified with by plugging the numbers into the TrackWebServiceClient sample that FedEx provides. – Dono Jul 21 '15 at 01:40
  • In my experience, these numbers were working in older versions of the api (we saw them work with v4), but not later versions (v8 doesn't work) – garrmark May 03 '16 at 14:56
  • fedex.track(:tracking_number => "377101283611590") Fedex::RateError: Fedex::RateError Please suggest me How I can proceed – yaswant singh Nov 23 '16 at 07:52
  • Note that these tracking numbers are listed here: https://www.fedex.com/us/developer/WebHelp/ws/2015/html/WebServicesHelp/WSDVG/Appendix_AA__L6_Mock_Tracking_Numbers.htm – froggythefrog Sep 07 '17 at 00:34
  • 1
    This does not work any longer, api version 10. Response: https://pastebin.com/Tvew1NaC – beetree Mar 07 '20 at 14:07
  • 1
    I was struggling with this same issue (yes in 2020) and wanted to point out a couple of things. MANY of the test tracking numbers provided on the FedEx website do not work at all. Only 1 of the SmartPost tracking numbers was working, which caused me hours of struggling through their garbage 700+ page "documentation" to find out why. Turns out many of the test tracking numbers are just not working and return the error "tracking number not found" code 9040. I also learned you can track live actual tracking numbers using the sandbox credentials, which helped immensely. I was able to test that way –  Jun 22 '20 at 17:10
  • User @DmcZx has tested these on 2022-02-08 and reports these codes still work, except for the four 12-digit codes which return a "Tracking number not found" error. – Jack Deeth Feb 08 '22 at 10:28
  • 2
    I tested this list of tracking numbers and most are actually still usable and do return relevant tracking information. The ones that do not work as of 8 Feb 2022 are: 568838414941, 797806677146, 797615467620, 581190049992 – DmcZx Feb 09 '22 at 01:48
10

In addition to: 123456789012

You can also use: 111111111111

** Every carrier (UPS, USPS, etc...) has lots of tracking numbers for lots of use-cases, but not FedEx... I find that very strange.

* Also... I am guessing FedEx expects you to use real tracking numbers even in their test environment. It's how I have been testing for multiple use-cases.

I hope this helps anyone, I have spent a while digging around.

rckehoe
  • 1,198
  • 15
  • 16
  • The 111... was the only one that worked for me in this thread. some other ones like 2's and 3's work also. Didnt try all of them – parliament Dec 02 '19 at 12:09
5

Short answer

Use one of the tracking numbers from the table below (copied from Mock Tracking Numbers for FedEx Express and FedEx Ground) or number 123456789012, but mind that the FedEx Sandbox environment might be unstable during your testing and you might need to use FedEx API mocks instead (either built in-house using Wiremock or ready-made by a vendor).

Scan Event Tracking Number Track By Reference Info. Shipment Account Number Ship Date Destination Postal Code
Shipment information sent to FedEx 449044304137821 Customer Reference: 115380173Ground Shipment ID: DMWsGWdnNN 510088000 15-08-2020 33126
Tendered 149331877648230 Ground Shipment ID: 149331877648230 510088000}] 15-08-2020 28752
Picked up 020207021381215 Ground Shipment ID: 53089528 510088000 15-08-2020 30549
Arrived at FedEx location 403934084723025 Ground Shipment ID: 403934084723025Department: 31826722 510088000 15-08-2020 99206
At local FedEx facility 920241085725456 Customer Reference: 0014243047/34684523 Ground Shipment ID: 920241085725456 510088000 15-08-2020 19720
At destination sort facility 568838414941 Shipper Reference: P218101_004154359Purchase Order: P218101_004154359 510088000 15-08-2020 85388
Departed FedEx location 039813852990618 Customer Reference: 4631962Ground Shipment ID: THE HOUSEDepartment: McGeePurchase Order: 3385158 510088000 15-08-2020 24740
On FedEx vehicle for delivery 231300687629630 Customer Reference: W62283340102Ground Shipment ID: 231300687629630Purchase Order: 6228334 510088000 15-08-2020 33126
International shipment release 797806677146 N/A
Customer not available or business closed (Delivery Exception 007) 377101283611590 Ground Shipment ID: 377101283611590 510088000 15-08-2020 95815
Local delivery restriction (Delivery Exception 083) 852426136339213 Customer Reference: 118402713013 510088000 15-08-2020 11375
Incorrect address (Delivery Exception 03) 797615467620 Shipper Reference: OTHER-TK104 510088000 15-08-2020 70810
Unable to deliver (Shipment Exception 099) 957794015041323 N/A
Returned to sender/shipper 076288115212522 Invoice: 81909 510088000 15-08-2020 50323
Clearance delay (International) 581190049992 N/A
Delivered 122816215025810 Customer Reference: PO#174724 510088000 15-08-2020 24273
Hold at location 843119172384577 N/A
Shipment canceled 070358180009382 Customer Reference: 15241402Ground Shipment ID: 070358180009382 510088000 15-08-2020 94545
Duplicate Tracking Number 713062653486 Unique Identifier 1: 2457821000~713062653486~FXUnique Identifier 2: 2457835000~713062653486~FX

Long answer

The FedEx Sandbox has numerous stability and test data problems. For example, if you use tracking code 123456789012 you will get a different response status depending on the state of the FedEx Sandbox environment.

If you are performing a one-off manual test of your Magento integration with FedEx API, then using the FedEx Sandbox should be sufficient, and you can go ahead and use one of the codes provided above.

If however, you are running automated regression or integration tests on a schedule or per commit then the instability of the environment might cripple your testing. For example, you might see flaky tests and flaky builds and have to spend time investigating them even though there is nothing wrong with your code or tests, it's just an issue with the FedEx Sandbox API.

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 Sandbox API:

  • Create and use mocks in your code instead of using the FedEx Sandbox. For example, Mockito in Java or uniuttest.mock in Python. 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 or Mountebank 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, which can be problematic if it's more than one API and you have a lot of work on your plate anyway.
  • Use ready-made FedEx API mocks like the one from Traffic Parrot instead of using the FedEx Sandbox. The advantage is they are created by experts and you can use them within minutes, just copy their mock API URL and use it instead of the FedEx one. You will have to pay for using them, which can sometimes be a downside of this option.

enter image description here

Wojtek
  • 1,410
  • 2
  • 16
  • 31
4

On their website they list the tracking numbers you can use:

https://www.fedex.com/en-us/developer/web-services/process.html#develop

Expand the Testing Environment and Mock Tracking Numbers subheading.

John
  • 2,653
  • 4
  • 36
  • 57
2

Here is a good one I pulled out of a code sample in the developer docs.

797843158299

grene
  • 31
  • 2
1

The above list of tracking numbers will indeed work when pointed to the following server endpoint:

https://wsbeta.fedex.com:443/web-services/track

Note that the only time these numbers will not work is during FedEx's scheduled maintenance windows.

Anonymous
  • 11
  • 1
0

You may try getting the ship functionality working first. That will provide you a tracking no that can be used in testing tracking. I did it this way and it works for me!

Darshana
  • 564
  • 1
  • 4
  • 13
0

We're trying to understand FEDEX tracking number testing too. I found this resource. But so far I'm not sure if the numbers work.

We'll update the answer later if we determine it helped or delete it if it does not: https://www.fedex.com/us/developer/webhelp/ws/2019/US/index.htm#t=wsdvg%2FAppendix_F_Test_Server_Mock_Tracking_Numbers.htm

Ruben Helsloot
  • 12,582
  • 6
  • 26
  • 49
atwellpub
  • 5,660
  • 11
  • 38
  • 52