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
- Validates that the job belongs to the authenticated user and the field map belongs to the job.
- Checks the field map is in 'draft' status (already confirmed or rejected maps cannot be changed).
- If corrections are provided, validates that every entry_id exists in the field map.
- Applies corrections and transitions the status atomically in a database transaction.
- Returns the updated field map with all entries reflecting any corrections.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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
- Success message with count of corrections applied
- Updated field map metadata with new status and timestamp
- Full list of entries reflecting any corrections (is_user_override = true for corrected entries)
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.
