API Trading: How to create a Trade by program?

API Trading: How to create a Trade by program?