I’ve set up a Stripe webhook that successfully triggers when an invoice is paid. The webhook sends the JSON payload shown in the attached screenshot, and I need to extract the field named invoice (highlighted in yellow in the image). This invoice field is crucial as it represents a userID column in my Glide app, used to identify and track the invoice.
The issue:
When I query the JSON body using the Glide Query JSON step, I can retrieve the very first id field, but I can’t figure out the correct path to extract the invoice field.
I’ve tried various paths like data.object.invoice, but it doesn’t seem to return the expected result.
Could someone guide me on the correct query path or provide insights on what might be going wrong? I am spending a dollar a go to try different path options to no avail… a smart tip would be great!
Next time you get stuck with something like this, you can paste the JSON output to ChatGPT/Claude and ask it to write a query using JSONata. That’s what Glide uses under the hood for Query JSON.
(Do you know if it’s possible to copy a payload from a webhook log into clipboard? One challenge was doing this versus sharing a screenshot with GPT. I couldn’t highlight the text in Glide payload log to do this nor could I find a place in Stripe that would provide it. Since the payload ran over 1 screen this made it troublesome).
My experience with ChatGPT is that it is terrible with JSONata. It has no problems with simple queries (those that I wouldn’t need it for), but fails miserably with any more complex queries. On two separate occasions I’ve given it a chance, and both times I’ve given up in exasperation after about an hour of going around in circles. I’ve not tried Claude.
In the limited times I try it, it works, but that was a long time ago and it’s likely I didn’t have a complex query.
I have used Claude ever since and it works really well with coding stuff. Recently we have the open source model DeepSeek, which has a cool thinking mode and it generates fine as well (and is free).