Some Questions regarding server script

1 - how can i call a whitelisted method within my server script. i.e i want to automatically create a Draft Delivery Note if a Sales Order verify some condition so i have to call the method make_delivery_note how can i do so ? I can’t use client custom script for this task because i want to use the REST API of frappe to sync orders with other platform so some of my Sales Order will not be created via the client interface

2 - How can i update a document status after it was submitted within a server script. i.e i defined a custom status field for my Sales Order [Invalid, Pending, In process … ] and i would like to update this status like the delivery status of the sales order doc but how can i do so if the doc is submitted ?