How to use Postman to Send Orders to Your Trading Account

Postman is an API testing tool that started in 2012 as a side project by Abhinav Asthana to simplify API workflow in testing and development. If you are a developer who wants to test and deploy REST API-based algo trading solutions then postman comes in handy without the hassle of writing, not even a single line of code just to test an API’s functionality.

In Algomojo we use Postman a lot to test and deploy robust API solutions for algotrading. Here is a video tutorial that explains how to use Postman to test Algomojo API to send orders and retrieve the order book.

Where to Download Postman?

You can goto www.postman.com/downloads to download the postman application. currently postman supports web based version and desktop application for both Windows and Mac. Install the application in your desktop.

Working with Algomojo API – Get Requests

Currently all the APIs supported by Algomojo are POST Requests

What is a POST Request?

POST requests are used to send data to the Algomojo API server to send orders, modify/cancel orders, or to retrieve the order book/position book details. The data sent to the server is stored in the request body of the HTTP request. In case of Algomojo API the request body needs to be send in json format.

Sample JSON Format to PlaceOrder to the Broker.

{
    "api_key":"86cbef19e7e61ccee91e497690d5814e",
    "api_secret":"8dbb8a1c91649810c82ccfc0ea9d715a",
    "data":
      {
        "strg_name":"Test Strategy",
        "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
        "Tsym":"NIFTY20NOVFUT",
        "exch":"NFO",
        "Ttranstype":"B",
        "Ret":"DAY",
        "prctyp":"MKT",
        "qty":"75",
        "discqty":"0",
        "MktPro":"NA",
        "Price":"0",
        "TrigPrice":"0",
        "Pcode":"NRML",
        "AMO":"NO"
      }
}

Step to Send the API Request

1)Copy the endpoint for PlaceOrder from the Algomojo Documentation and use the POST request and key in the API endpoint details.

2)Select the Body Tab

3)Select the Raw checkbox

4)select the JSON format from the dropdown

5)Create your API Post request as shown above. Request details can be get from the Algomojo Documentation

6)Press the send Button and in return you will be getting the API response as shown above

2 thoughts on “How to use Postman to Send Orders to Your Trading Account”

  1. How ALGOMOJO API bridge comes into picture here? since you are exposing API directly?
    in the json body, we are sending broker details only, how you identify algomojo user?

    if bridge required, do we have cloud facility to install the application?

    1. Using the Algomojo API Key and API Secret key we identify the Algomojo User. Algomojo Bridge Installation is required only for Amibroker, MT4, MT5 and Ninjatrader based modules
      it is not required for custom coders like python based trading or even for Tradingview applications.

Leave a Reply to Rajandran R Cancel Reply

Your email address will not be published. Required fields are marked *