Postback URL not working

I have setup a valid postback URL (https) on the cloud. When i try to update the app postback url section, i get the following error:
The postback url could not be reached. Please make sure the port is 80 or 443

I am able to reach this URL via postman... Can you tell me what the issue is ?

Secondly, I'm an individual user trying to place an order via the API, do i require the postback URL ? Or will the websocket suffice ?

  • sujith
    If it is for personal use then websocket order updates would make sense. Ideally, postbacks are for platforms.
    Order updates on postbacks are only for the orders that are placed via the Kite Connect app and not orders placed from the Kite web or app whereas order updates via websockets are for all the orders.
  • sujith
    But what to chose depends on the type of setup you have and which one goes well for you.
  • ramzh
    Thanks for the clarification.

    Two additional question:
    1. I hope the place order API is a synchronous call ? ie, the call would return only after the order place event is completed ?
    2. I don't see an explicit API for square off ? is it controlled via the transaction type ?
    For buy orders - Constants.TRANSACTION_TYPE_BUY and for Sell orders Constants.TRANSACTION_TYPE_SELL ?
    Is my understanding right ?

  • sujith
    I think all the libraries are built with support for an asynchronous behavior by default. If you want it to be synchronous call then you will have to use await like feature.

    For MIS/NRML/CNC square off, you will have to place an order in the opposite transaction type with the same quantity and product type.
    For CO/BO, you need to use the exit order feature.
  • sujith
    Please create a new thread for new queries as it might help others who are looking for the same.

    Many times, it is possible that the query is already answered, you can search before asking the query.
  • ramzh

    I was testing using ICICIBANK instrument, placing an order at 10.30 PM Friday 22nd May 2020.
    The API was invoked as follows:

    At first i tried a Stoploss order ( Variety = Bracket Order) with the following parameters:
    Exchange: Constants.EXCHANGE_NSE,
    TradingSymbol: "ICICIBANK",
    TransactionType: Constants.TRANSACTION_TYPE_BUY,
    Quantity: 1,
    Price: ,
    Product: Constants.PRODUCT_MIS,
    OrderType: Constants.ORDER_TYPE_SL,
    Validity: Constants.VALIDITY_DAY,
    SquareOffValue: 2,
    StoplossValue: 2,
    TriggerPrice: ,
    Variety: Constants.VARIETY_BO

    I got a success response, but when i checked the order status in zerodha, i see the following error:
    The exchange connection did not accept the order (adapter). Please retry.

    Later i tried a Limit order ( Variety = After Market Order ) with the following parameter:
    Exchange: Constants.EXCHANGE_NSE,
    TradingSymbol: "ICICIBANK",
    TransactionType: Constants.TRANSACTION_TYPE_BUY,
    Quantity: 1,
    Price: ,
    Product: Constants.PRODUCT_CNC,
    OrderType: Constants.ORDER_TYPE_LIMIT,
    Validity: Constants.VALIDITY_DAY,
    Variety: Constants.VARIETY_AMO

    This time it worked.

    My Question: can only AMO orders be placed for ICICIBANK ? If not, what went wrong in the first order ?
  • sujith
    sujith edited May 26
    A 200 for order placement means order placement is successful and not the execution.
    Once an order is placed it could go to OPEN, TRIGGER PENDING, CANCELED, or REJECTED status based on the many conditions that are met.
    Post-market hours, our RMS rejects all the orders placed except the AMO. If our RMS rejects order then the response will be in the format of Kite Exception as mentioned here.
    Since many API clients test order placements post-market, we opened only ICICBANK for placing orders post market hours. Even though we allow from our RMS, it gets rejected at the OMS since it is off-trading hours.

    You can place AMO orders after market hours. You can check out the allowed timings here.
  • ramzh
    Thank you. We can close this discussion...
This discussion has been closed.