Walmart is rolling out a new discount for online shoppers that will be challenging for Amazon to beat.

Starting April 19, the retailer will offer a discount to customers who ship purchases to one of Walmart's more than 4,700 US stores instead of to a home or elsewhere.

Here's how it works: While checking out online for a purchase — for example, a $1,698 Vizio flat-screen TV — shoppers will be given the option to ship the item to a store or have it sent elsewhere.

If the shopper chooses to ship the TV to a store, Walmart will knock $50 off the purchase price. If the customer chooses to ship it to their home, the price will stay the same and Walmart will deliver it for free.

Discounts will vary for every product. Generally, bigger items will have steeper discounts because they cost more to ship.

The offer will be hard for Amazon, Walmart's biggest rival, to match, because Amazon doesn't have any physical stores.

"We're leveraging Walmart's unique set of assets in a way that will save consumers more money," Walmart e-commerce head Marc Lore told Business Insider.

Walmart will offer the deal, which the company is calling a "pickup discount," on 10,000 items starting next week. By June, more than 1 million items will have the discount.

Here are some other examples of discounts that will be offered:

$2.55 off a Lego toy that originally was $23.99.

$7.40 off a Britax infant car seat that originally was $148.05.

$4.46 off a Coleman cooler that originally was $111.49.

But there's a catch: Discounts will be applied only to items that aren't already available in stores.

Lore said the program wouldn't require any additional investment from Walmart.

"The cost to get stuff from a fulfillment center to a store all together on a truck is not that expensive," Lore told Business Insider. "The expensive part is when you deliver [the items] to an individual person's home."

By cutting out that leg of the trip, Walmart will save money and pass those savings on to consumers.

Walmart has been ramping up its e-commerce operations since its $3 billion purchase last year of Jet.com, which was founded by Lore.

The idea for the "pickup discount" was inspired by Jet, which is known for its so-called smart-cart options that allow shoppers to save money if they bundle purchases into larger packages or give up services like free returns.

Walmart plans to implement more options like those, according to Lore.

"In the coming months, you will continue to see ways for us to empower customers to shop smarter," he said.