I’d like to end a visit via a rest call.
Is this supposed to be done via setting the stopDatetime or is there something else that needs to be done to end it?
Yes it is done by setting current date as stopDate.
check this https://docs.openmrs.org/doc/org/openmrs/api/impl/VisitServiceImpl.html#endVisit-org.openmrs.Visit-java.util.Date-
method that end visits basically does the same.