Programmable shut down the device?

At night I have scheduled my nas to shut Down.
I have made a small program (C#) that runs prior to backing up on my WD MyCloud EX2 and is waking the device, Works fine.
Now I want to shut Down the device after the backup has finished.
I know this is possible (remotely shutting down the device) because WD QuickView can do it.
I assume I have to supply credentials, no problem.
Does anybody know, what command is sent to shut it Down?

Hopefully an experienced User will be able to provide the requested information.