In this study, we examined the genetic architecture of EHR-derived phenotypes of opioid use disorder (OUD) in a large health care system. Using individual-level genomic data, we conducted a genome-wide association analysis for OUD and estimated the genetic contributions and correlations of major substance use disorders and complications. Our findings illustrate the potential value of this novel approach in the elucidation of the genetic underpinnings of OUD.