Parsoid relies on the data-parsoid mapping when performing html to wikitext conversion. For this purpose, the data-parsoid mapping is stashed when Visual Editor loads the HTML to edit. When the edit is about to be saved, the modified HTML coming from the Visual Editor client needs to be converted to wikitext, with the help of the stashed data-parsoid mapping.
This functionality is currently implemented in the transform endpoint RESTbase, which loads the stashed mapping, injected it into the HTML, and sends the result to the parsoid extension's transform endpoint.
In the future, this functionality should be covered by the new transform endpoint in MW core. Ideally, this functionality would be implemented in a service or helper class, so it can be used by ApiVisualEditorEdit directly, bypassing the REST framework.