what do you mean with "assign the correct document type"? To create the PO I use the REST call
POST -> api.businesscentral.dynamics.com/.../purchaseOrders
after that, with the returned PO id, I add a purchase order line to it...
when using the REST call to get back the list of POs, I can see both the ones I create via REST API and those ones I create using the browser UI. From the data structure, I can see no difference between them