OS X Execute a script while printing
Common Unix Printing System

macOS uses the Common Unix Printing System (CUPS) for printing. This open source system does allow for calling scripts and more.

Knowing this, the search for cups pre-print script returns some good starting points.

Virtual Printer to Real Printer Workflow

The StackOver questions Programming a Filter/Backend to 'Print to PDF' with CUPS from any Mac OS X application and Run a script on files sent to a CUPS print queue? offer an example where a virtual printer is used to pre-process a print job before passing it onto a real printer.

In your situation, the pre-processing could be to power on your printer via the REST API.

Alternatively…

See also Run command before and after printing with CUPS?