BEIJING — Zhang Heng barged through an exam-room door, surprising a doctor and a patient. He didn’t have time to knock. In Mr. Zhang’s business, every second counts.

“You have to hand it directly to the person,” said Mr. Zhang, one of the legions of package couriers in Beijing who help power China’s online shopping boom. He spoke as he blitzed through a surgical wing, medical storeroom and patient ward delivering parcels small and large, soft and square, to doctors and nurses in an effort to ensure the right person gets the right package.

“Otherwise,” Mr. Zhang said, “you may get fined.”

The Chinese e-commerce industry has been built on the backs of couriers — called kuaidi, or express delivery, in China — like Mr. Zhang. They number 1.2 million, by one survey, and online retailers like Alibaba use them to zip packages to customers by scooter or three-wheeled electric cart. Across China, the world’s largest market for package delivery, a courier shouting “kuaidi!” through a door or a phone signals your package has arrived.

But for the couriers — who are largely unskilled workers from China’s interior — the work can be low-paying and difficult. It is coming under scrutiny from labor activists and legal experts who say many couriers face punishing hours and harsh working conditions.