Webhook Message

Malformed Json

Could not parse JSON payload.

This message indicates that the JSON payload provided in the request could not be parsed. TradersPost requires that the JSON payload be well-formed and conform to standard JSON syntax. If the JSON is malformed or contains errors, the request will not be processed.

For example, if the JSON payload includes syntax errors such as missing commas, unmatched brackets, or incorrect use of quotes, the request will not be processed.

This error can occur due to several reasons, such as:

  • Missing or extra commas in the JSON structure.
  • Unmatched curly braces or square brackets.
  • Incorrect use of double quotes around keys and values.
  • Typographical errors or incorrect formatting in the JSON payload.
  • Ensure that your JSON payload is correctly formatted and well-formed to avoid this error.

Invalid JSON example where a comma is missing after limitPrice line:

{
    "ticker": "AAPL",
    "action": "buy",
    "orderType": "limit",
    "limitPrice": 150
    "timeInForce": "day"
}

Here is the same example with the JSON syntaxt error fixed:

{
    "ticker": "AAPL",
    "action": "buy",
    "orderType": "limit",
    "limitPrice": 150,
    "timeInForce": "day"
}

In the above examples, a valid JSON payload includes proper syntax with all necessary commas and correctly matched brackets and quotes, ensuring the request meets the required parameters for processing.

Ready to automate your trading? Sign up for free today.