---
title: "Apply a column mapping"
method: PATCH
path: "/v1/invoices/imports/{id}/mapping"
tags: ["Invoice Imports"]
---

# Apply a column mapping

`PATCH /v1/invoices/imports/{id}/mapping`

Maps each detected CSV column header onto a canonical invoice field, re-validates every row, and returns the batch with its new ready/error tally.

## Path parameters

- `id` string, required

## Request body

- ApplyMappingRequestDTO
  - `mapping` object, required

## Response `200`

OK

- object — Standard response containing data and its metadata if any
  - `data` ImportResponseDTO
    - `created_at` string
    - `created_by` string
    - `created_rows` integer
    - `error_rows` integer
    - `failed_rows` integer
    - `id` string
    - `organization_id` string
    - `ready_rows` integer
    - `send_mode` 'draft' | 'create_and_send'
    - `source_filename` string
    - `status` 'pending' | 'validating' | 'ready' | 'creating' | 'completed' | 'failed'
    - `total_rows` integer
    - `updated_at` string
  - `has_more` boolean

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/paymongo/apis/paymongo-api.md) · [All operations](https://skmtc.net/paymongo/apis/paymongo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/paymongo/paymongo-api/versions/c18f9a027b2c/schema)
