SimplyParseDocs

Data mapping

Reshape parsed_data into the exact JSON your destination system expects, before the webhook is sent.

A data mapping is a JSON template attached to a webhook. Before each delivery, SimplyParse fills the template from the entry's parsed_data and sends the result in place of data.parsed_data. The rest of the payload (document_id, entry_id, is_valid, validation_errors) is unchanged.

Use it when the receiving system expects different key names, types or structure, so you don't need glue code in between.

Add a mapping

  1. Open the parser → Integrations.
  2. Save the webhook first; mapping is available on saved webhooks.
  3. Open the webhook's data mapping, paste your template, and save.

Without a mapping, parsed_data is sent exactly as extracted.

A complete example

Given this extracted data:

parsed_data
{
  "invoice_number": "INV-20418",
  "invoice_date": "2026-03-12",
  "vendor": { "name": "Northwind Supplies", "gstin": "27AAEPM1234C1Z5" },
  "tax_amount": 7360.17,
  "line_items": [
    { "description": "Steel brackets", "quantity": "50", "unit_price": 610.5, "hsn_code": "7308" },
    { "description": "Anchor bolts", "quantity": "200", "unit_price": 89.9, "hsn_code": "731815" }
  ]
}

this mapping:

Mapping
{
  "DocumentNumber": "$parsed_data.invoice_number",
  "PostingDate": "$parsed_data.invoice_date",
  "Supplier": {
    "Name": "$parsed_data.vendor.name",
    "TaxId": "$parsed_data.vendor.gstin"
  },
  "TaxAmount": { "$str": "$parsed_data.tax_amount" },
  "Currency": "INR",
  "PurchaseOrder": "$parsed_data.po_number",
  "Items": {
    "$map": "$parsed_data.line_items",
    "template": {
      "LineNo": "$index",
      "Material": "$item.description",
      "Quantity": { "$int": "$item.quantity" },
      "UnitPrice": { "$float": "$item.unit_price" },
      "HSN": { "$pad": "$item.hsn_code", "length": 8, "char": "0", "side": "right" },
      "Invoice": "$parsed_data.invoice_number"
    }
  }
}

produces this data.parsed_data in the webhook:

Delivered
{
  "DocumentNumber": "INV-20418",
  "PostingDate": "2026-03-12",
  "Supplier": { "Name": "Northwind Supplies", "TaxId": "27AAEPM1234C1Z5" },
  "TaxAmount": "7360.17",
  "Currency": "INR",
  "PurchaseOrder": null,
  "Items": [
    { "LineNo": 0, "Material": "Steel brackets", "Quantity": 50, "UnitPrice": 610.5, "HSN": "73080000", "Invoice": "INV-20418" },
    { "LineNo": 1, "Material": "Anchor bolts", "Quantity": 200, "UnitPrice": 89.9, "HSN": "73181500", "Invoice": "INV-20418" }
  ]
}

Reference

Paths

A string starting with $ is a path into the data. Anything else is copied as is.

ExpressionResolves to
"$parsed_data.invoice_number"A top-level field.
"$parsed_data.vendor.name"A nested field. Separate levels with ..
"$parsed_data.line_items.0.description"An item in a list, by zero-based index.
"$parsed_data"The whole extracted object.
"INR", 42, true, nullLiteral values, copied unchanged.

A path that doesn't exist resolves to null rather than failing. In the example, PurchaseOrder is null because there's no po_number.

Objects and lists in the template can be nested as deeply as you need. Every value inside them is resolved the same way.

$map: transform every item in a list

{ "$map": "<path to a list>", "template": { ... } }

Produces one output object per item. Inside template you can use:

VariableValue
$itemThe current item, for example $item.description.
$indexThe item's position, starting at 0.
$parsed_dataStill available, for values from the parent record.

If the path isn't a list (missing or null), the result is [].

Type casts

Wrap a path in a single-key object to convert its value:

DirectiveResultExample
{ "$str": "<path>" }Text7360.17 → "7360.17"
{ "$int": "<path>" }Whole number, decimals dropped"50" → 50; "12.9" → 12
{ "$float": "<path>" }Decimal number"610.50" → 610.5

A value that can't be converted becomes null. For example, { "$float": ... } on "48,250.00" gives null because of the thousands separator. Use a number field type in the parser so amounts arrive as numbers.

$pad: fixed-width codes

{ "$pad": "<path>", "length": 10, "char": "0", "side": "left" }
OptionDefaultDescription
length0Minimum length. Longer values are left as they are.
char" "The fill character. Only its first character is used.
side"left"left pads at the start (7308 → 0000007308); right pads at the end.

A missing value becomes an empty string "".

Tips

  • Start without a mapping. Look at a real payload first, then map only what your destination needs.
  • Keep keys stable. If you rename a field in the parser, update the mapping's paths too, or those values become null.
  • Signatures still work. The signature is computed over the mapped payload, so verification is unchanged.

On this page