Build a schema mapping table between webhooks

Map fields, transform data types, and define fallback values between source and target webhooks. Ideal when connecting two tools with mismatched JSON schemas.

Prompt

Prompt
Act as an integration engineer. Create a comprehensive field mapping and data transformation table between the two webhook schemas or systems below.

- Map every source key to its corresponding target key.
- Specify required data type conversions (e.g., epoch to ISO-8601, string to integer, comma-separated to array).
- Define static fallbacks or defaults for missing, null, or undefined values.
- Highlight critical fields where data truncation or loss might occur.

Output format:
### Integration Overview
### Schema Mapping Table (Columns: Source Field, Source Type, Target Field, Target Type, Transformation Logic, Default Value)
### Required Data Transformations
### Edge Cases and Truncation Risks

Here are the two schemas or sample payloads:

Example output

Example for: mapping Shopify order webhooks to internal ERP inventory API

Integration Overview

Connects outbound Shopify orders/create webhook payload to the internal ERP CreateSalesOrder endpoint, converting nested order lines into a flat inventory array.

Schema Mapping Table
Source FieldSource TypeTarget FieldTarget TypeTransformation LogicDefault Value
idIntegerexternal_order_refStringCast integer to stringNone (Required)
created_atString (ISO-8601)order_timestampInteger (Unix)Parse ISO-8601 to Epoch millisecondsCurrent Timestamp
customer.emailStringbilling_contact_emailStringTrim spaces and convert to lowercase"no-reply@domain.com"
total_priceString ("124.50")total_amount_centsIntegerMultiply float value by 100 and cast to int0
line_items[].skuArray of Stringsitems[].product_codeArray of StringsDirect copy, uppercase all characters"UNASSIGNED_SKU"
line_items[].quantityIntegeritems[].units_orderedIntegerDirect mapping1
financial_statusStringis_paidBooleanTrue if status equals "paid", else Falsefalse
Required Data Transformations
  • Price Normalization: Shopify sends currency amounts as floating-point strings ("19.99"). Target ERP requires integer cents (1999) to prevent floating-point rounding errors.
  • Phone Format: Strip all punctuation and whitespace from shipping_address.phone to conform to E.164 standard.
Edge Cases and Truncation Risks
  • Missing SKUs: Custom or non-inventory line items in Shopify have null SKUs; ensure fallback UNASSIGNED_SKU routes to review rather than halting API execution.
  • Text Field Limits: Target ERP notes field enforces a 255-character limit; trim incoming note strings and log a warning if text exceeds length.
Written by AI from this prompt. Your results will vary.

Paste the JSON payloads or schema documentation for both apps at the end of the prompt in ChatGPT, Claude, or Gemini. Ask the model to generate the JavaScript or Python transformation code as a follow-up.

Make it repeatable

Keep using this prompt without pasting it in every time.

Keep exploring

More in Automation & Workflows