In Webhook problem to creating Json data

i create a webhook to send data after_insert for quotaion i want to fetch data item group name of item table which for json data my json body is

{
    "merchantId": aaaaaaaa,
    "template": {
        "name": "quotation_notification",
        "language": "en"
    },
    "source": "crm",
    "wabaNumber": "99999999999",
    "recipients": [
        "{{doc.contact_mobile}}"
    ],
    "params": {
        "header": "https://erp.hitecs.in/files/Hi Tech Company Profile .pdf",
        "body": [
            "{{doc.contact_display}}",
            "{{2}}",
            "{% set owner = frappe.get_doc('User', doc.owner) %}{{ owner.full_name }}",
            "{% set owner = frappe.get_doc('User', doc.owner) %}{{ owner.role_profile_name }}",
            "{% set owner = frappe.get_doc('User', doc.owner) %}{{ owner.mobile_no }}"
        ]}
}

in place of 2 variable i want to send item_name
how make my json so it fetch item name

Hi @Mack:

You should iterate over item child table …
Check this example:

{
    "name": "{{ doc.name }}",
    "sales_order_date": "{{ doc.transaction_date }}",
    "items": [
        {% for item in doc["items"] %}
        {
            "item_code": "{{ item.item_code }}",
            "item_name": "{{ item.item_name }}",
            "qty": {{ item.qty }},
            "rate": {{ item.rate }},
            "amount": {{ item.amount }}
        }{% if not loop.last %},{% endif %}
        {% endfor %}
    ]
}

Hope this helps.

thank you so much