I am trying to put together a simple webhook that will send invoice details to an integration system I am writing. If I use form-encoded for the request body, I can get it to send the list of items, but I want to be able to customize which fields it sends, so I think I need to use JSON. However, when I try to do that, it throws an error saying it’s invalid JSON. I am sure it’s just that I am unfamiliar with the templating engine, but I can’t figure out how to make it work. Current JSON:
{
"quickbooksId": "{{doc.quickbooks_id}}",
"name": "{{doc.name}}",
"items": [
{%for item in doc.items%}
{
"item_code": "{{item.item_code}}"
}
{%endfor%}
]
}