Genetic polymorphisms contribute to patients' variability in pain perception and response to opioid treatment. The present study evaluated the association of calcitonin gene-related peptide (CGRP) 4218T/C polymorphisms with fentanyl consumption over 24 h postoperatively in patients after major abdominal surgery. Eighty-five patients undergoing major abdominal surgery under general anaesthesia were recruited. For postoperative analgesia, epidural fentanyl and intravenous paracetamol were provided. The CGRP 4218T/C genotype was analysed, and the association between the genotype of the patient and the total consumption of fentanyl in the first 24 h after surgery was assessed. The association between different genotypes, the severity of postoperative pain and the side effects of opioids were also studied. Our study population distribution included 52.9% of the T/T genotype (wild homozygote), 35.3% of the T/C genotype (heterozygote) and 11.8% of the C/C genotype (mutant homozygote). Mean (standard deviation) total fentanyl consumption in the first 24 h was found to be highest in the C/C group (212.0 [7.5] μg), followed by the T/T group (182.8 [9.9] μg) and was the least in the T/C group (159.6 [7.5] μg). The C/C group reported higher pain scores in all the study periods. There was no significant difference in the side effects of opioids, such as nausea, vomiting, sedation among different genotypes of CGRP 4218T/C. The polymorphism of CGRP 4218T/C affects postoperative pain perception and analgesic consumption. Patients with the C/C genotype had higher postoperative fentanyl consumption and pain scores.