Once upon a time there was a carpet merchant named Abdullah. His father being dead, his father's first wife's relatives frequently come to bother him about his life. He manages and weaves himself a fanciful daydream about really being a lost prince betrothed to a beautiful princess. Except one day, a man comes to him to sell a carpet. Rude though he is, his carpet is unquestionably magical -- it can, in the classic style, fly.
Being aware that men had trained horses to slip loose of their new masters and return after being sold, Abdullah doesn't risk the same being possible with carpets; he sleeps on it. When he has a lovely dream of a night garden and Flower in the Night, a beautiful princess so sheltered from men that she assumes he's a woman -- he doesn't look like her father -- he accidentally leaves his cap behind, and so discovers the next morning that it was no dream.
He prepares to return to her, but when he does so, he is only in time to see her being abducted by a djinni. And her father's guards are out looking for a culprit.
The rest of the tale involves a cloud that looks very much like a princess, a cat that can turn to a panther, a genie in a bottle, the question of whether being hanged is preferable to being an immortal toad, someone thinking that Abdullah visited a wizard for a reason that he did not intend, many princesses, temper tantrums, a dog belonging to a cook, a discharged soldier, and much more.