Skip to main content
Field mapping converts source-specific transaction data into Matcher’s canonical schema. This normalization is required to compare transactions across systems and apply matching rules consistently.

Why field mapping?


External systems rarely share the same field names, formats, or sign conventions. For example:
SystemAmount fieldDate fieldReference field
Bank AtransactionAmountpostDatecheckNumber
Bank Bamttransaction_dateref_num
ERPAMOUNT_USDGL_DATEDOC_NUM
Field maps standardize these variations into a single schema that Matcher can validate, normalize, and match.

Matcher’s standard schema


Required fields

Every transaction must provide these fields after mapping:
FieldTypeDescriptionExample
transaction_idStringUnique identifier within the source"TXN-2024-001"
amountDecimalTransaction amount (up to 4 decimal places)1234.56
currencyStringISO 4217 currency code"USD"
dateDateTransaction date (YYYY-MM-DD)"2024-01-15"

Optional fields

FieldTypeDescriptionExample
referenceStringExternal reference or description"Invoice #1234"
counterpartyStringOther party in the transaction"Acme Corp"
typeStringTransaction direction/type"credit", "debit"
categoryStringTransaction category"payment", "fee"
posting_dateDatePosting date"2024-01-16"
value_dateDateValue/settlement date"2024-01-17"
external_idStringExternal system identifier"BANK-REF-999"
metadataObjectSource-specific fields{"department": "sales"}

Creating field maps


Basic field map

cURL
curl -X POST "https://api.matcher.example.com/v1/field-maps" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "name": "Chase Bank Statement Format",
   "description": "Maps Chase bank CSV exports to Matcher schema",
   "source_type": "csv",
   "mappings": [
     {
       "source_field": "Transaction ID",
       "target_field": "transaction_id"
     },
     {
       "source_field": "Amount",
       "target_field": "amount"
     },
     {
       "source_field": "Currency",
       "target_field": "currency"
     },
     {
       "source_field": "Post Date",
       "target_field": "date"
     },
     {
       "source_field": "Description",
       "target_field": "reference"
     }
   ]
 }'
Response
{
  "id": "fmap_001",
  "name": "Chase Bank Statement Format",
  "description": "Maps Chase bank CSV exports to Matcher schema",
  "source_type": "csv",
  "mappings": [
    {
      "source_field": "Transaction ID",
      "target_field": "transaction_id"
    },
    {
      "source_field": "Amount",
      "target_field": "amount"
    },
    {
      "source_field": "Currency",
      "target_field": "currency"
    },
    {
      "source_field": "Post Date",
      "target_field": "date"
    },
    {
      "source_field": "Description",
      "target_field": "reference"
    }
  ],
  "created_at": "2024-01-15T10:00:00Z"
}

Assign a field map to a source

curl -X PATCH "https://api.matcher.example.com/v1/sources/src_bank456" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "field_map_id": "fmap_001"
 }'

Data transformations


Field maps can apply transformations to normalize formats and conventions before matching.

Available transformations

TransformationDescriptionExample
uppercaseConvert to uppercase"abc""ABC"
lowercaseConvert to lowercase"ABC""abc"
trimRemove leading/trailing whitespace" abc ""abc"
parse_dateParse date by format"01/15/2024""2024-01-15"
parse_numberParse number with locale"1,234.56"1234.56
absAbsolute value-100100
negateNegate number100-100
multiplyMultiply by factor100 × 0.011
replaceString replacement"USD$""USD"
extractRegex extractionExtract numbers from string
defaultDefault if emptynull"UNKNOWN"
concatConcatenate fieldsfield1 + field2

Transformation examples

cURL
curl -X POST "https://api.matcher.example.com/v1/field-maps" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "name": "Legacy Bank Format with Transformations",
   "source_type": "csv",
   "mappings": [
     {
       "source_field": "TXN_NUM",
       "target_field": "transaction_id",
       "transformations": [
         {
           "type": "trim"
         },
         {
           "type": "uppercase"
         }
       ]
     },
     {
       "source_field": "AMOUNT",
       "target_field": "amount",
       "transformations": [
         {
           "type": "parse_number",
           "options": {
             "locale": "en-US"
           }
         },
         {
           "type": "multiply",
           "options": {
             "factor": 0.01
           }
         }
       ]
     },
     {
       "source_field": "TXN_DATE",
       "target_field": "date",
       "transformations": [
         {
           "type": "parse_date",
           "options": {
             "format": "MM/DD/YYYY"
           }
         }
       ]
     },
     {
       "source_field": "CURR",
       "target_field": "currency",
       "transformations": [
         {
           "type": "replace",
           "options": {
             "search": "$",
             "replace": ""
           }
         },
         {
           "type": "uppercase"
         },
         {
           "type": "default",
           "options": {
             "value": "USD"
           }
         }
       ]
     }
   ]
 }'
Response
{
  "id": "fmap_002",
  "name": "Legacy Bank Format with Transformations",
  "mappings": [
    {
      "source_field": "TXN_NUM",
      "target_field": "transaction_id",
      "transformations": [
        {
          "type": "trim"
        },
        {
          "type": "uppercase"
        }
      ]
    },
    {
      "source_field": "AMOUNT",
      "target_field": "amount",
      "transformations": [
        {
          "type": "parse_number",
          "options": {
            "locale": "en-US"
          }
        },
        {
          "type": "multiply",
          "options": {
            "factor": 0.01
          }
        }
      ]
    },
    {
      "source_field": "TXN_DATE",
      "target_field": "date",
      "transformations": [
        {
          "type": "parse_date",
          "options": {
            "format": "MM/DD/YYYY"
          }
        }
      ]
    },
    {
      "source_field": "CURR",
      "target_field": "currency",
      "transformations": [
        {
          "type": "replace",
          "options": {
            "search": "$",
            "replace": ""
          }
        },
        {
          "type": "uppercase"
        },
        {
          "type": "default",
          "options": {
            "value": "USD"
          }
        }
      ]
    }
  ]
}

Date format patterns

Common parse_date patterns:
PatternExample inputOutput
YYYY-MM-DD2024-01-152024-01-15
MM/DD/YYYY01/15/20242024-01-15
DD/MM/YYYY15/01/20242024-01-15
YYYY-MM-DDTHH:mm:ssZ2024-01-15T10:30:00Z2024-01-15
MMM DD, YYYYJan 15, 20242024-01-15
DD-MMM-YYYY15-Jan-20242024-01-15

Computed fields


Use computed fields when values must be derived rather than copied from a single source field.

Concatenation

{
  "target_field": "reference",
  "computed": true,
  "expression": {
    "type": "concat",
    "fields": [
      "DOC_TYPE",
      "DOC_NUM"
    ],
    "separator": "-"
  }
}
Input: DOC_TYPE: "INV", DOC_NUM: "12345" Output: reference: "INV-12345"

Conditional mapping

{
  "target_field": "type",
  "computed": true,
  "expression": {
    "type": "conditional",
    "conditions": [
      {
        "if": {
          "field": "DR_CR",
          "equals": "D"
        },
        "then": "debit"
      },
      {
        "if": {
          "field": "DR_CR",
          "equals": "C"
        },
        "then": "credit"
      }
    ],
    "default": "unknown"
  }
}

Amount sign based on type

{
  "target_field": "amount",
  "computed": true,
  "expression": {
    "type": "conditional",
    "conditions": [
      {
        "if": {
          "field": "TXN_TYPE",
          "equals": "DEBIT"
        },
        "then": {
          "type": "negate",
          "field": "AMOUNT"
        }
      }
    ],
    "default": {
      "field": "AMOUNT"
    }
  }
}

Mapping examples by source type


Bank statements (csv)

Source format

Transaction ID,Post Date,Description,Amount,Balance
CHK001,01/15/2024,Check #1234,-500.00,10500.00
DEP001,01/15/2024,Mobile Deposit,1500.00,12000.00
FEE001,01/15/2024,Monthly Service Fee,-12.00,11988.00

Field map

{
  "name": "Bank Statement CSV",
  "source_type": "csv",
  "mappings": [
    {
      "source_field": "Transaction ID",
      "target_field": "transaction_id"
    },
    {
      "source_field": "Post Date",
      "target_field": "date",
      "transformations": [
        {
          "type": "parse_date",
          "options": {
            "format": "MM/DD/YYYY"
          }
        }
      ]
    },
    {
      "source_field": "Description",
      "target_field": "reference"
    },
    {
      "source_field": "Amount",
      "target_field": "amount",
      "transformations": [
        {
          "type": "parse_number",
          "options": {
            "locale": "en-US"
          }
        }
      ]
    },
    {
      "target_field": "currency",
      "computed": true,
      "expression": {
        "type": "constant",
        "value": "USD"
      }
    },
    {
      "target_field": "type",
      "computed": true,
      "expression": {
        "type": "conditional",
        "conditions": [
          {
            "if": {
              "field": "Amount",
              "less_than": 0
            },
            "then": "debit"
          }
        ],
        "default": "credit"
      }
    }
  ]
}

Result

[
  {
    "transaction_id": "CHK001",
    "date": "2024-01-15",
    "reference": "Check #1234",
    "amount": -500.0,
    "currency": "USD",
    "type": "debit"
  },
  {
    "transaction_id": "DEP001",
    "date": "2024-01-15",
    "reference": "Mobile Deposit",
    "amount": 1500.0,
    "currency": "USD",
    "type": "credit"
  }
]

ERP systems (json)

Source format

{
  "entries": [
    {
      "DOC_ID": "JE-2024-001",
      "GL_DATE": "2024-01-15",
      "GL_ACCOUNT": "1000",
      "AMOUNT_USD": 150000,
      "DR_CR": "D",
      "DESCRIPTION": "Vendor Payment - Acme Corp"
    }
  ]
}

Field map

{
  "name": "ERP Journal Entry Format",
  "source_type": "json",
  "root_path": "entries",
  "mappings": [
    {
      "source_field": "DOC_ID",
      "target_field": "transaction_id"
    },
    {
      "source_field": "GL_DATE",
      "target_field": "date"
    },
    {
      "source_field": "AMOUNT_USD",
      "target_field": "amount",
      "transformations": [
        {
          "type": "multiply",
          "options": {
            "factor": 0.01
          }
        }
      ]
    },
    {
      "target_field": "currency",
      "computed": true,
      "expression": {
        "type": "constant",
        "value": "USD"
      }
    },
    {
      "source_field": "DESCRIPTION",
      "target_field": "reference"
    },
    {
      "target_field": "type",
      "computed": true,
      "expression": {
        "type": "conditional",
        "conditions": [
          {
            "if": {
              "field": "DR_CR",
              "equals": "D"
            },
            "then": "debit"
          },
          {
            "if": {
              "field": "DR_CR",
              "equals": "C"
            },
            "then": "credit"
          }
        ]
      }
    },
    {
      "source_field": "GL_ACCOUNT",
      "target_field": "metadata.gl_account"
    }
  ]
}

Result

{
  "transaction_id": "JE-2024-001",
  "date": "2024-01-15",
  "amount": 1500.0,
  "currency": "USD",
  "reference": "Vendor Payment - Acme Corp",
  "type": "debit",
  "metadata": {
    "gl_account": "1000"
  }
}

Payment gateways (xml)

Source format

<transactions>
 <transaction>
 <id>PAY-2024-001</id>
 <timestamp>2024-01-15T14:30:00Z</timestamp>
 <amount currency="USD">99.99</amount>
 <merchant>Store #123</merchant>
 <status>completed</status>
 </transaction>
</transactions>

Field map

{
  "name": "Payment Gateway XML Format",
  "source_type": "xml",
  "root_path": "transactions/transaction",
  "mappings": [
    {
      "source_field": "id",
      "target_field": "transaction_id"
    },
    {
      "source_field": "timestamp",
      "target_field": "date",
      "transformations": [
        {
          "type": "parse_date",
          "options": {
            "format": "ISO8601"
          }
        }
      ]
    },
    {
      "source_field": "amount",
      "target_field": "amount",
      "transformations": [
        {
          "type": "parse_number"
        }
      ]
    },
    {
      "source_field": "amount@currency",
      "target_field": "currency"
    },
    {
      "source_field": "merchant",
      "target_field": "reference"
    },
    {
      "target_field": "type",
      "computed": true,
      "expression": {
        "type": "constant",
        "value": "credit"
      }
    }
  ]
}

Result

{
  "transaction_id": "PAY-2024-001",
  "date": "2024-01-15",
  "amount": 99.99,
  "currency": "USD",
  "reference": "Store #123",
  "type": "credit"
}

Validating field maps


Validate field maps using representative sample data before enabling them in production.

Validate field map

cURL
curl -X POST "https://api.matcher.example.com/v1/field-maps/fmap_001/validate" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "sample_data": [
     {
       "Transaction ID": "TXN001",
       "Amount": "1,234.56",
       "Post Date": "01/15/2024",
       "Currency": "USD",
       "Description": "Test transaction"
     }
   ]
 }'

Best practices


Use real samples from the source system to catch parsing and transformation issues early.
Make format changes explicit (for example, Bank CSV v2.0) to preserve reimport and auditability.
Add descriptions for transformations that change semantics (for example, “Amount in cents, divide by 100”).
Use default only for optional fields and choose values that make downstream behavior explicit.
Standardize debits and credits across sources before matching.
When source formats change, create a new field map rather than modifying an existing one.

Next steps