# POST /api/v1/inventory/po-import/preview

> Preview PO import with SKU matching

- **Tag:** inventory:po_import
- **Operation ID:** `preview_po_import_api_v1_inventory_po_import_preview_post`

## Description

After reviewing AI column mappings, returns line items with SKU match status against the product catalog.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `POPreviewRequest`

- `file_id` (string · required)
- `selected_sheets` (array · string · required)
- `sheet_mappings` (array · POSheetMappingConfirmation · required) → `POSheetMappingConfirmation`
  - `sheet_name` (string · required)
  - `mapping` (object · required) — Map of standard field name → 0-based column index.
  - `data_start_row` (integer)
  - `exclude_rows` (array · integer)

## Responses

### 201 — Successful Response

Schema: `POPreviewResponse`

- `file_id` (string · required)
- `line_items` (array · POPreviewLineItem) → `POPreviewLineItem`
  - `row_number` (integer · required)
  - `sku` (string · required)
  - `item_name` (string)
  - `quantity` (integer · required)
  - `unit_price_cents` (integer)
  - `match_status` (string) (one of: matched, unmatched, ambiguous)
  - `matched_variant_id` (string)
  - `matched_variant_name` (string)
  - `matched_sku` (string)
  - `match_confidence` (number)
  - `candidates` (array · object)
- `summary` (POPreviewSummary) → `POPreviewSummary`
  - `total_lines` (integer)
  - `matched_lines` (integer)
  - `unmatched_lines` (integer)
  - `ambiguous_lines` (integer)
  - `total_quantity` (integer)
  - `total_cents` (integer)
  - `skipped_rows` (integer)
- `metadata` (POMetadata) → `POMetadata`
  - `suggested_po_name` (string)
  - `suggested_vendor_name` (string)
  - `suggested_po_number` (string)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error - Invalid data format

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/inventory/po-import/preview' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "file_id": "string",
  "selected_sheets": [],
  "sheet_mappings": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/inventory/po-import/preview', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "file_id": "string",
  "selected_sheets": [],
  "sheet_mappings": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "file_id": "string",
  "selected_sheets": [],
  "sheet_mappings": []
}

response = httpx.post("https://api.ondayzero.com/api/v1/inventory/po-import/preview", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/inventory-po-import/preview-po-import
- OpenAPI slice: https://www.ondayzero.com/docs/reference/inventory-po-import/preview-po-import/openapi.json
- Other endpoints in **inventory:po_import**: https://www.ondayzero.com/docs/reference/inventory-po-import
