Opiate refers to any drug that is derived from the opium poppy, including the natural products, morphine and codeine, and the semi-synthetic drugs such as heroin. Opioid is more general, referring to any drug that acts on the opioid receptor.
Opioid analgesics comprise a large group of substances which control pain by depressing the central nervous system. Large doses of morphine can produce higher tolerance levels, physiological dependency in users, and may lead to substance abuse. Morphine is excreted unmetabolized, and is also the major metabolic product of codeine and heroin. Morphine is detectable in the urine for several days after an opiate dose.