The Benito Juarez market in Oaxaca
The Benito Juarez market in Oaxaca Photograph by Nathaniel Parish Flannery

Here’s How Amazon is Figuring Out Mexico’s Tricky Market

The mid-day traffic of late-model SUVs and luxury sedans chokes the narrow streets of Polanco, one of Mexico City’s most exclusive districts. BMW car dealerships and boutiques selling luxury clothing brands and watches from companies such as Hublot and Patek Philippe crowd the neighborhood’s narrow, tree-lined streets. The roads are simply not designed to support the flow of visitors, residents, and well-dressed office workers who venture out to eat lunch at nearby restaurants and coffee shops. Polanco, a neighborhood filled with recently designed skyscrapers, stately turn-of-the century mansions, and streets with names such as Carlos Dickens and Oscar Wilde, epitomizes Mexico’s emerging market of wealthy young professionals, and it’s home to a demographic that many retailers are betting is willing to avoid the city’s traffic and embrace e-commerce.

Amazon (amzn), which launched in Mexico in June 2015, is one of several global companies that is paying close attention to Mexico’s rapidly growing e-commerce market. Sitting in a conference room in a tall office tower with a view of Polanco and the sprawl of Mexico City, Juan Carlos Garcia, the 47-year-old CEO of Amazon Mexico, explains, “We saw a big opportunity in the Mexican market. It’s a market which right now is at $12 billion and growth has been in the double digits.”

Mexico benefits from a number of unique demographic and geographic characteristics that make it one of the most promising e-commerce markets in Latin America. The nation's proximity to the U.S. makes it an easy target for retailers north of the border looking to boost their international customer base. At the same time, the rapidly expanding group of young, working-age Mexicans is quickly becoming a target market for global retain chains.

“Mexico is a one of a kind opportunity for e-commerce because of the demographics. For the next 15 years we’ll see new people enter the job market, many of whom are tech-savvy and have disposable income,” Garcia explains. Around half of Mexico's population is below 30.

Companies such as Wal-Mart (wmt), Home Depot (hd), and local supermarkets such as Superama are also investing heavily in e-commerce in Mexico. Beer giant Anheuser Busch-Inbev (bud) has opened an online beer delivery service called Beer House that allows customers to select customized 12 packs of big brands such as Budweiser and Negra Modelo and Mexican-made craft brews such as Colimita and Cucapa.

But Mexico, despite its sizable upside, is a market laden with quirks and challenges. Six out of 10 Mexicans don’t have ATM or debit cards. While Amazon has made great efforts to allow customers to use the widest variety of debit cards, other companies are going even further to target the wide segment of Mexico’s publication that does not use the formal banking system. Wal-Mart offers cash on delivery, and InBev gives customers the option of paying with a cash transfer from a local convenience store chain.

Such strategies are an implicit reminder that while the 24 million residents in Mexico’s top two income brackets represent an important new market for global luxury brands and e-commerce companies, much of Mexico’s population remains offline and disconnected. Around half of the nation's residents live in poverty, and according to the latest estimates from Mexico’s national statistics agency, more than half the population works in the informal economy.

In Mexico’s rural south, poverty and economic informality rates are even higher. From the sky, visitors arriving in the colonial city of Oaxaca in southwestern Mexico will notice the expanse of green hills and small-plot corn and bean farms that hug the perimeter of the municipality and a near total absence of industrial development in the periphery.

The city’s small shops continue to offer residents and visitors a more traditional retail experience. But even in its quietest corners, change is underway. Felipe Rios, a 78-year-old merchant who runs a small stand at the bustling Benito Juarez market, says he sees increasing competition from national and global retail companies that can offer customers perks such as home delivery and 0% financing. “Big stores can give credit for 12 months, 18 months," says Rios, who only takes cash, "and that [competition] cuts into our business.”

Although small businesses give customers the chance to negotiate, he sees small vendors losing out to the chain stores. “Big businesses will eat up the small shops,” he says. Rios also sees e-commerce as a potential source of competition but a lesser one. “You have to know how to use the Internet and pay for the Internet and a computer or a cell phone,” he says. Pulling out his smartphone and looking at its touch screen, Rios adds, “I bought this, but I don’t know how to use it.” He thinks the older generation in Mexico will be wary of embracing e-commerce: “They don’t trust banks, [and] they don’t use technology.”

And while residents of Mexico City and other big cities, such as Guadalajara and Monterrey, are modernizing and adopting a more globalized style of life, the residents of many of Mexico’s indigenous communities in the southern states of Oaxaca, Chiapas, and Guerrero, the poorest three states in Mexico, are being left out of the modern era of development and connectivity. Almost 15% of Oaxaca’s schools lack electricity, and more than 65% don’t have computers, while 90% lack Internet.

Shannon O’Neil, a Mexico expert from the Council on Foreign Relations in New York explains: “Even with the economic challenges there is a growing middle class [in Mexico] with disposable income—people with money to buy goods." But closer to the U.S., she says, "e-commerce has flourished more than in the South.”

Even so, Amazon has found a way to set up deliveries to 99% of Mexico’s zip codes, even to the remote villages in states like Oaxaca.

“We’ve had some cases of customers buying drones—we’ve delivered to small towns in Oaxaca that are way outside of the big cities. We got feedback that they were very happy we could make the delivery because the nearest store that had the product was 10 hours away,” Amazon’s Garcia explains. Like Wal-Mart and local luxury department stores, such as Palacio de Hierro, Amazon is betting big on e-commerce in Mexico.

Garcia is confident that the investment will pay off. “E-commerce is still in the early stage in Mexico, but with a young population, Mexico will be one the top 10 economies in the world. We’re not there yet with e-commerce," he says, "but we’ll catch up.”

All products and services featured are based solely on editorial selection. FORTUNE may receive compensation for some links to products and services on this website.

Quotes delayed at least 15 minutes. Market data provided by Interactive Data. ETF and Mutual Fund data provided by Morningstar, Inc. Dow Jones Terms & Conditions: http://www.djindexes.com/mdsidx/html/tandc/indexestandcs.html. S&P Index data is the property of Chicago Mercantile Exchange Inc. and its licensors. All rights reserved. Terms & Conditions. Powered and implemented by Interactive Data Managed Solutions