After staying at home one afternoon for a delivery of discounted toilet disinfectant that never came, Valentin Romanov, a Stockholm information-technology manager, installed a special lock at his apartment’s entrance. When no one is in, deliverymen can unlock the door and slip packages inside. Four months later Romanov has doubled his spending online and said that he cannot imagine life without in-home deliveries.

These are sweet words for delivery companies and online retailers, Amazon included, that are setting up partnerships with lock manufacturers to overcome a big hurdle for e-commerce.

Conventional deliveries fail so often that a parcel is driven to a home an average of 1.5 times in the Nordic region, said Kenneth Verlage, head of business development at Postnord, a logistics giant operating in Denmark, Finland, Norway and Sweden. It is an expensive inefficiency made worse, he said, by the fact that recipients still often have had to wait for a failed delivery.

Some couriers leave packages on doorsteps, but this invites theft. Of 1,000 Americans surveyed this year by Shorr, a packaging firm, nearly a third had been victims of “porch piracy,” as this is known. Two-fifths avoid certain online purchases for fear of it.

A number of companies now sell wirelessly connected locks which a courier’s delivery staff can open using a passcode or smartphone app after the resident has issued a temporary authorization, either before leaving home or remotely. Deliveries are filmed by an indoor security camera paired with the lock. The short videos are sent to the parcel addressees and typically end, comically in Romanov’s view, with a jiggle of the door handle from outside to show that the departing delivery person has locked up.

Amazon began offering in-home deliveries in 37 American cities in November. Shoppers who have installed a special lock and camera, costing $199, can select in-home delivery at checkout. Like most companies offering the service, Amazon is tightlipped about user numbers. The chief executive of August Home, a San Francisco maker of in-home delivery locks, said that already hundreds of thousands of delivery drivers, dog-walkers, cleaners and Airbnb guests use its app keylessly to enter others’ homes.

Offerings are multiplying. In 2018 August Home will go to Australia and Britain, and Postnord will launch in-home delivery in four Nordic countries. Wal-Mart and Sears have tried it, and Sears even tested unattended appliance repairs. Five logistics companies and two Swedish supermarket chains are trying or using locks from Glue, a firm based in Stockholm, for in-home deliveries.

Skeptics say that these efforts will not amount to much. Plenty of consumers will be fearful about theft. Rhino Security Labs, a Seattle computer-security firm, claims that it has hacked into and shut off the video in one Amazon lock-and-camera system. In-home deliveries are incompatible with burglar alarms, and what if an improperly fenced-off dog or cat slips outside? Or if an heirloom on display gets knocked over?

These are tricky questions — but e-commerce companies have unlocked harder ones.