Many theories have been proposed to explain the development of endometriosis, and recently, autoimmune aetiology has been suggested. Besides, it is well known that endometriosis, especially the advanced disease, may impair fertility. B lymphocyte stimulator (BLyS) is a cytokine produced by macrophages and is necessary for normal B cell development. One of the most studied polymorphisms is the -817C/T in the promoter region of the gene. We aimed to assess the association between endometriosis-related infertility and idiopathic infertility and the BLyS -817C/T polymorphism in a Brazilian population. We performed a case–control study comprising 165 infertile women with endometriosis, 83 with idiopathic infertility and 145 fertile and assessed the association with BLys -817C/T polymorphism. BLyS -817C/T polymorphism was detected using TaqMan PCR. The results were analysed statistically, and a P-value < 0.05 was considered significant. The results disclosed similar genotype and allelic frequencies between endometriosis-related infertility (P = 0.225) and control group, regardless of the disease stage (P = 0.213 and P = 0.462, respectively). However, a statistically significant difference was observed regarding idiopathic infertile group (P = 0.048) compared with controls. Considering the dominant and recessive inheritance models, no significant differences in both endometriosis and idiopathic infertility group were found. The genotype frequencies were in Hardy–Weinberg equilibrium in all studied groups. The results point to a possible association between BLyS -817C/T polymorphism and idiopathic infertility in Brazilian population.