def METHOD_NAME(cls, data):
    """Build $ref for the organisation of the acquisition invoice."""
    library_pid = data.get('library', {}).get('pid')
    if not library_pid:
        library_pid = data.get('library').get(
            '$ref').split('libraries/')[1]
    org_pid = Library.get_record_by_pid(library_pid).organisation_pid
    url_api = '{base_url}/api/{doc_type}/{pid}'
    org_ref = {
        '$ref': url_api.format(
            base_url=get_base_url(),
            doc_type='organisations',
            pid=org_pid or cls.organisation_pid)
    }
    data['organisation'] = org_ref