You can use PO_Document_Control_PUB.control_document for this purpose.
Prior to calling the API you should set your global context to reflect the application, user and responsibility used to perform the cancel action. If you do not set this context, the API will not be able to identify or update your data. If you are calling the API from an environment that already has the context set you do not need to set it again.
Please refer to Purchasing Document Open Interface (PDOI) manual / MFG open interface manual for details on parameters to be used and usage example etc.