Here’s a UBAQ that has the code in it for checking out parts. That should get you started
Why though? Epicor native doesn’t remove lines from the ECO tables. Just leave them alone, and you shouldn’t be using these tables for anything other than info for currently checked out parts.
REST only adds the capability to call stuff from outside of the system. If you are already in the system (BPM/UBAQ etc) you can do anything you would be doing with REST. It won’t give you any extra abilities.
This is definitely possible, so post your code and errors and someone can help you with it.