confirm_field_map Database

Confirm or reject a draft field map with optional corrections

Overview

Transitions a draft field map to 'confirmed' or 'rejected' status. When confirming, you can optionally apply corrections to specific mapping entries — overriding the target entity, target column, metadata routing, transformation, or confidence for any entry. Corrections and the status transition happen atomically in a single transaction, so either all changes apply or none do.

How It Works

  1. Validates that the job belongs to the authenticated user and the field map belongs to the job.
  2. Checks the field map is in 'draft' status (already confirmed or rejected maps cannot be changed).
  3. If corrections are provided, validates that every entry_id exists in the field map.
  4. Applies corrections and transitions the status atomically in a database transaction.
  5. Returns the updated field map with all entries reflecting any corrections.

Input Parameters

ParameterTypeRequiredDescription
job_id string required Clone job ID
field_map_id string required ID of the field map to confirm or reject
action string required 'confirm' or 'reject'
corrections array optional Optional array of corrections. Each correction has entry_id (required) plus optional overrides: target_entity, target_column, metadata_entity, metadata_key, transformation, confidence

What You Get Back

Example Use Case

After reviewing a field map with get_field_map, confirm it with corrections: change a low-confidence 'pa_color' mapping from metadata to a product_option entity, and fix a '_sale_price' transformation to multiply_100. Both corrections and the status transition happen atomically.

Tips

Use get_field_map first to retrieve entry IDs needed for corrections.
Corrections are only applied when the action is 'confirm' — rejected maps ignore corrections.
A field map can only be confirmed or rejected once (must be in 'draft' status).
If any correction references a non-existent entry, the entire operation is rolled back.

Related Tools