Purchase Order Status not updated after Purchase Receipt completed via REST API

In another attempt, I tried to use the “whitelisted” function make_purchase_receipt of Purchase Order.

So, I created a PO as described before. But, instead of POST’ing a Purchase Receipt, I did the following:

pr_endpoint = f'{erpnext_url}/api/method/erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt'
pr_data = {
    "source_name": po_id
}

response = login_session.post(pr_endpoint, json=pr_data)

This also resulted in a HTTP 200 and the response body contained a Purchase Order object.

However, the response body did not contain an id, or a “document name”. I could see, that the status of the PR was draft. But, neither the UI nor the API showed me this draft PR. Moreover, the corresponding PO also did not have a PR in the Connections tab.