Improper POSTback JSON format for the Order Updates Webhook

axtrics
We recently subscribed in Kite to accept POST Webhooks for Order updates. We are receiving the Webhooks at the desired endpoint but the Payload that is coming is incorrectly formatted. It is also not the same as mentioned here in the docs
https://kite.trade/docs/connect/v3/postbacks/

Below is how the actual Payload is coming, Can someone from Kite check and fix this?:
{"timestamp":"24.02.2023-13:40:19.576","{\"user_id\":\"CJXXXX\",\"unfilled_quantity\":0,\"app_id\":69266,\"checksum\":\"34307b4e2d798eae9ed052520a005c28a14e018ed67da7a9af9ee93dac9f68cc\",\"placed_by\":\"CJXXXX\",\"order_id\":\"230224401620351\",\"exchange_order_id\":\"1100000019825782\",\"parent_order_id\":null,\"status\":\"COMPLETE\",\"status_message\":null,\"status_message_raw\":null,\"order_timestamp\":\"2023-02-24 13:37:20\",\"exchange_update_timestamp\":\"2023-02-24 13:37:20\",\"exchange_timestamp\":\"2023-02-24 13:37:20\",\"variety\":\"regular\",\"exchange\":\"NSE\",\"tradingsymbol\":\"DCBBANK\",\"instrument_token\":3513601,\"order_type\":\"MARKET\",\"transaction_type\":\"SELL\",\"validity\":\"DAY\",\"product\":\"MIS\",\"quantity\":43,\"disclosed_quantity\":0,\"price\":0,\"trigger_price\":0,\"average_price\":115.05,\"filled_quantity\":43,\"pending_quantity\":0,\"cancelled_quantity\":0,\"market_protection\":0,\"meta\":{},\"tag\":null,\"guid\":\"xxxxxxxx\"}":""}
  • axtrics
    Anyways, We have manually parse it as JSON
  • rakeshr
    Below is how the actual Payload is coming, Can someone from Kite check and fix this?:
    As explained in the documentation, the payload comes as a byte and it's in JSON format, you need to decode the raw byte reponse. You can decode it as easily as json.loads(postback_resp_byte).
Sign In or Register to comment.