I'm encountering a persistent issue with the HTTP Request node in my n8n workflow when trying to upsert a metafield in Shopify via their REST API.
How can I safely send a JSON string inside a JSON object in the jsonBody without n8n interpreting it incorrectly or throwing JSON parameter needs to be valid JSON?
Thanks in advance for your help!
— Alexandre
Describe the problem/error/question
Problem in HTTP Request node: “JSON parameter needs to be valid JSON”.
Context:
I’m using this node to send a POST or PUT request to the Shopify REST API:
POST /admin/api/2025-07/orders/{order_id}/metafields.json
PUT /admin/api/2025-07/metafields/{metafield_id}.json
I pass a metafield value that is a JSON stringified object.
My jsonBody looks like this (expression in value):
={"sav_thread":{"created_at":"2025-08-14T16:44:02.461Z","total_messages":1,"messages":[{"id":1755189842,"type":"customer_question","date":"2025-08-14T09:05:06.000Z","subject":"Autre question","content":"Bonjour, J'ai bien reçu le tipi, mais je n'ai pas reçu 16 morceaux de bois comme indiqué sur votre site. J'en ai eu seulement 12, ce qui fait que le tipi est complètement affaissé. De plus l'un des morceaux s'est cassé quand je l'ai enfoncé dans la partie blanche en plastique. Je l'ai recollé avec du scotch mais je préfèrerai qu'il soit remplacé. Pourriez vous me renvoyer 5 morceaux de bois ainsi que 4 attaches blanches qui seront manquantes pour fixer ce qui me manquait ? Cordialement,","marketplace":"Nature & Découvertes"}]}}
{
"metafield": {
"namespace": "custom",
"key": "sav_content",
"type": "json",
"value": ""={\"sav_thread\":{\"created_at\":\"2025-08-14T16:44:02.461Z\",\"total_messages\":1,\"messages\":[{\"id\":1755189842,\"type\":\"customer_question\",\"date\":\"2025-08-14T09:05:06.000Z\",\"subject\":\"Autre question\",\"content\":\"Bonjour, J'ai bien reçu le tipi, mais je n'ai pas reçu 16 morceaux de bois comme indiqué sur votre site. J'en ai eu seulement 12, ce qui fait que le tipi est complètement affaissé. De plus l'un des morceaux s'est cassé quand je l'ai enfoncé dans la partie blanche en plastique. Je l'ai recollé avec du scotch mais je préfèrerai qu'il soit remplacé. Pourriez vous me renvoyer 5 morceaux de bois ainsi que 4 attaches blanches qui seront manquantes pour fixer ce qui me manquait ? Cordialement,\",\"marketplace\":\"Nature & Découvertes\"}]}}""
}
}
Hi @jabbson, the “=” was on the previous step. I remove it, just as the quotation mark at the beginning and at the end. Thanks a lot for your follow-up.