A here-document is a redirection, you can't redirect into a variable.
When the command line is parsed, redirections are handled in a separate step from variable assignments. Your command is therefore equivalent to (note the space)
That is, it assigns an empty string to your variable, then redirects standard input from the here-string into the command (but there is no command, so nothing happens).
is valid, as is
It's just that there is no command whose standard input stream can be set to contain the data, so it's just lost.
This would work though:
Here, the command that receives the here-document is
cat, and it copies it to its standard output. This is then what is assigned to the variable by means of the command substitution.
In your case, you could instead use
python -m json.tool <<END_JSON
JSON data here
without taking the extra step of storing the data in a variable.
It may also be worth while to look into tools like
jo to create the JSON data with the correct encoding:
jo type=account customer_id=1234 firstname.lastname@example.org random_data="some^Wdata"
^W is a literal Ctrl+W character, would output
So the command in the question could be written
jo type=account customer_id=1234 email@example.com |
python -m json.tool