Post Back URL notification json data is changed & not able to decode on our server

TRADERAYS
Hi It seems the earlier order_id field is changed in Order notification to post back URL. As a result parsing the json data is failing, but there is no update in website about parameters change.

So please update the web document or the sample json status notification format sent to postback URL
  • sujith
    Hi @TRADERAYS,
    We haven't changed anything on postback response. Can you paste a raw response here?
  • TRADERAYS
    Hi Sujit, we are getting following error on console.

    org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "order_id" (Class com.nb.ats.exchange.bean.order.OrderResponse), not marked as ignorable
    at [Source: java.io.StringReader@dae8595; line: 1, column: 14] (through reference chain: com.nb.ats.exchange.bean.order.OrderResponse["order_id"])


    It seems postback notification message is not having order_id parameter.

    dump is disabled by default, will enable & share the dump later
  • vishnus
    Hi @TRADERAYS ,

    I just tested the postback and got following response, and it does contain order_id. Is it happening still at your end?
    {
    "order_id": "xxxx",
    "exchange_order_id": "",
    "order_timestamp": "2017-07-07 10:41:03",
    "exchange_timestamp": "",
    "status": "REJECTED",
    "status_message": "xxxxx",
    "placed_by": "xxx",
    "user_id": "xxx",
    "tradingsymbol": "INFY",
    "exchange": "NSE",
    "transaction_type": "BUY",
    "order_type": "MARKET",
    "quantity": 1,
    "filled_quantity": 0,
    "unfilled_quantity": 0,
    "price": 0,
    "average_price": 0,
    "trigger_price": 0,
    "product": "NRML",
    "validity": "DAY",
    "tag": "",
    "checksum": "xxx"
    }
  • TRADERAYS
    Yes it seems format is changed in postback URL compared to earlier format

    Earlier Format is like below :
    {
    "status": "success",
    "data": {

    "order_id": "151220000000000",
    "parent_order_id": "151210000000000",
    "exchange_order_id": null,
    "placed_by": "AB0012",
    "variety": "regular",
    "status": "REJECTED",

    "tradingsymbol": "ACC",
    "exchange": "NSE",
    "instrument_token": 22,
    "transaction_type": "BUY",
    "order_type": "MARKET",
    "product": "NRML",
    "validity": "DAY",

    "price": 0.0,
    "quantity": 75,
    "trigger_price": 0.0,

    "average_price": 0.0,
    "pending_quantity": 0,
    "filled_quantity": 0,
    "disclosed_quantity": 0,
    "market_protection": 0,

    "order_timestamp": "2015-12-20 15:01:43",
    "exchange_timestamp": null,

    "status_message": "RMS:Margin Exceeds, Required:0, Available:0",
    "tag": null
    }
    }


    So we have to change the json conversion to new format
    {
    "order_id":"170707000376846",
    "exchange_order_id":"1100000000274218",
    "order_timestamp":"2017-07-07 11:34:21",
    "exchange_timestamp":"2017-07-07 11:33:21",
    "status":"CANCELLED",
    "status_message":"",
    "placed_by":"xxxxx",
    "user_id":"xxxxx",
    "tradingsymbol":"NIFTY17JULFUT",
    "exchange":"NFO",
    "transaction_type":"SELL",
    "order_type":"LIMIT",
    "quantity":75,
    "filled_quantity":0,
    "unfilled_quantity":75,
    "price":9658,
    "average_price":0,
    "trigger_price":0,
    "product":"BO",
    "validity":"DAY",
    "tag":"170707AA",
    "checksum":"b37bd8246eeb5469dce3572cd7f9b38c828f3575a360522e540e6f26f1b3d4cd"
    }



    So its better clients get the notification when JSON structure is reformatted in future, so that we can change and will not have any impact on our system.

    Thank you
  • vishnus
    Hi TRADERAYS,

    The response you have pasted here is retrieving one single order using GET request.
    https://kite.trade/docs/connect/v1/#retrieving-orders

    The postback structure has always been the one in the documentation.
    https://kite.trade/docs/connect/v1/#postback-webhooks
  • TRADERAYS
    With the change it's working fine, you can close the issue. thank you
This discussion has been closed.