generate external_id