How to Book ONCF Train Tickets in Morocco With a Foreign Card (2026 Guide)
ONCF's website rejects most foreign credit cards. Here's what actually works in 2026 — third-party booking sites, in-person options, and everything you need to know about Al Boraq and Al Atlas trains.
How to Book ONCF Train Tickets in Morocco With a Foreign Card (2026 Guide)
If you've tried to book a Morocco train ticket online and had your card declined on the ONCF website, you're not alone — this is one of the most commonly reported frustrations for foreign visitors, and it has a straightforward fix.
Why Your Card Gets Rejected
ONCF's online payment gateway is built around domestic 3D Secure verification, and it frequently flags foreign-issued cards as suspicious even when there's nothing wrong with the card itself. It's not a problem with your bank — it's the gateway's strict, Morocco-centric fraud settings failing to recognize non-Moroccan card formats. This affects a large share of North American and European cards, so if your first attempt fails, don't assume it's your card.
What Actually Works in 2026
Third-party booking platforms — Sites built specifically around Moroccan rail (for example moroccotrain.com, or general Asia/Africa rail platforms like 12Go) resell ONCF and Al Boraq tickets, accept standard international cards without the 3D Secure friction, and typically offer English-language checkout and support. This is the most reliable option if you're booking from outside Morocco before your trip.
Buy in person after arrival — Ticket counters at major stations and the Casablanca Mohammed V Airport train station sell tickets on the spot and accept foreign cards and cash. If you're flying into Casablanca, this is a convenient first stop before you even leave the airport.
A VPN set to a French IP — Some travelers report this getting the ONCF site to accept a foreign card, since it changes how the gateway reads the transaction's origin. It's not guaranteed and we wouldn't build a whole plan around it, but it's a free thing to try before paying a booking-site markup.
What doesn't reliably help: switching browsers, clearing cookies, or trying a different card from the same country — the rejection is a gateway-level pattern match, not a one-off glitch, so retrying the identical approach usually gets the identical result.
The Al Boraq High-Speed Line
Al Boraq is Africa's first high-speed rail line, connecting Tangier, Kenitra, Rabat, and Casablanca at up to 320 km/h.
- Tangier to Casablanca: about 2 hours 10 minutes
- Tangier to Rabat: about 1 hour 20 minutes
- Frequency: roughly hourly departures from early morning to evening
- Price: around 149 MAD (~€14) second class, 224–243 MAD (~€21) first class for the full Tangier–Casablanca run, cheaper the further ahead you book
- On board: free WiFi, air conditioning, and a cafeteria car
This line only covers the northern Casablanca–Tangier corridor — it doesn't extend to Marrakech, Fes, or anywhere near the Sahara.
The Regular Al Atlas Network
Outside the high-speed corridor, ONCF's standard "Al Atlas" trains connect Marrakech, Casablanca, Rabat, Meknes, and Fes. These are slower but still comfortable, with 1st class (reserved, wider seats) and 2nd class (cheaper, unreserved) options, plus overnight services with sleeper cabins on the longer routes.
Where the Train Network Doesn't Reach
Morocco's rail network is genuinely useful for the Tangier–Rabat–Casablanca–Marrakech corridor and the line up to Fes, but it stops well short of the Sahara — there's no train to Merzouga, Zagora, or the desert region at all. If your trip includes the dunes, you'll need a bus, private transfer, self-drive, or an organized tour for that leg; see our Marrakech to Merzouga train guide for why the train + bus combination for that specific route usually isn't worth it.
FAQ
Why does the ONCF website reject my card?
The payment gateway uses strict domestic 3D Secure settings that frequently misflag foreign-issued cards, regardless of your bank or balance. It's a known gateway limitation, not an error on your end.
What's the easiest fix?
Book through a third-party rail platform that resells ONCF tickets and accepts international cards directly, or buy in person at a station or the Casablanca airport train counter after you land.
Is Al Boraq worth taking?
Yes, if your route is within the Tangier-Rabat-Casablanca corridor — it's fast, comfortable, and reasonably priced. It doesn't help for reaching Marrakech, Fes, or the Sahara.
Can I book Moroccan trains from home before my trip?
Yes, through a third-party booking platform. Buying directly on the ONCF site from a foreign card is the one path most likely to fail.
Do I need a train at all if I'm visiting the Sahara?
No — the rail network doesn't reach Merzouga or Zagora. Most Sahara-bound travelers use a private transfer, a bus, or a multi-day guided tour instead.
Contact Information
For more information or to plan your trip, contact us at:
Email: hello@merzougaway.com WhatsApp/Phone: +212675203319 / +212668534981
MerzougaWay Team
We are a passionate team of local guides dedicated to sharing the beauty and culture of our home, Morocco. Our journey began with a simple desire to offer authentic, memorable experiences that go beyond the typical tourist trails.


