def build_oxo_payload(id_list: list, target_list: list, distance: int) -> dict:
    """
    Build a dict containing the payload with which to make a POST request to OxO for finding xrefs
    for IDs in provided id_list, with the constraints provided in target_list and distance.

    :param id_list: List of IDs with which to find xrefs using OxO
    :param target_list: List of ontology datasources to include
    :param distance: Number of steps to take through xrefs to find mappings
    :return: dict containing payload to be used in POST request with OxO
    """
    payload = {}
    payload["ids"] = id_list
    payload["mappingTarget"] = target_list
    payload["distance"] = distance
    return payload