Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I'm receiving a webhook json with the following line item.
This item has a quotation mark in it's title, and the keen eye will notice "name": "Thing that is inches long - Standard / 1"".
This isn't valid JSON since the product titles " isn't escaped with a backward slash.
{
"id": 12345,
"admin_graphql_api_id": "gid://shopify/LineItem/12345",
"attributed_staffs": [],
"current_quantity": 1,
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 26,
"name": "Thing that is inches long - Standard / 1"",
"price": "17.39",
"price_set": {
"shop_money": {
"amount": "17.39",
"currency_code": "USD"
},
"presentment_money": {
"amount": "17.39",
"currency_code": "USD"
}
}
}
I imagine this issue must occur if customers type a quote in their checkout information too, like a house name, or such. Has anyone else run into this issue?
Solved! Go to the solution
This is an accepted solution.
Hey @samuel_webster_
That's strange, it should be escaped. How are you parsing the JSON? Can you try/confirm with https://webhook.site ?
Scott | Developer Advocate @ Shopify
This is an accepted solution.
Hey @samuel_webster_
That's strange, it should be escaped. How are you parsing the JSON? Can you try/confirm with https://webhook.site ?
Scott | Developer Advocate @ Shopify
Yeah, webhook raw confirms it is. I'm not unescaping through, I'm capturing raw input and chucking it into a db to deal with later. MySQL must be unescaping it on insert or something, thanks for the idea to check it raw elsewhere.