API RecipesBy Zapinner1 min read
Match Two Customer Records
Check whether an incoming record refers to an existing customer before you insert it, with a confidence score.
Problem
Before inserting a new customer, you want to know whether they already exist — so you update instead of creating a duplicate.
Request
bash
curl -X POST https://zapinner.com/api/v1/match \
-H "Authorization: Bearer $ZAPINNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"record": { "name": "Jon Smith", "email": "j.smith@acme.io" },
"against": [ { "id": "con_1a2b", "name": "John Smith", "email": "j.smith@acme.io" } ],
"fields": ["name", "email"]
}'Output
json
{ "match": true, "confidence": 0.94, "id": "con_1a2b" }Explanation
Match is the one-to-many version of dedupe: it scores your record against a candidate set and returns the best match with a confidence value. Above your threshold, update the existing record; below it, insert.
Error handling
Handle the structured error for malformed payloads. A no-match is a normal result (match: false), not an error.
Production considerations
- Run match on the write path — it only fires on creates, not reads.
- Normalize identity fields first for accurate scoring.
Related APIs
Dedupe (whole-set pass), Normalize (prepare identity fields).
Fix messy data before it breaks your workflow.
Start free with 1,000 credits a month across every capability — no credit card required.
