Create Or Delete A Sales Order Line

You can create a Wave template that has the select Cancel Partially Unallocated option checked. Then run the Wave Template for that order and this will cancel the order lines on the orders that are not allocated.
Note: You cannot delete an order line using the Orders User Interface (UI) or init_stage_interface API for an order that is partially allocated.