KintsugiKintsugi

Validate a CSV file

POST/imports/validate

Check a CSV file's contents before uploading it. Always answers 200; check isValid and errors to see whether the file passed.

Authorization

Api-KeystringRequired

Your secret API key. Include it with every request.

Headers

Api-Versiondate

Release date, as YYYY-MM-DD. Defaults to 2026-07-21.

Organization-Idstring

Target organization id (Organization-Id selector).

Connection-Idstring

Target connection id; resolves to its organization.

Entity-Idstring

Platform entity id; resolves to a connection's organization.

Entity-Sourcestring

Optional source to disambiguate an Entity-Id.

Body

fileNamestringRequired

Name of the file being validated.

datastringRequired

Raw CSV file contents.

sourcestringRequired

Import source the file was exported for.

directionPublicTransactionDirectionEnum

SALE or PURCHASE for the whole file; blank per-row direction cells take this value.

Available options:SALEPURCHASE

Response

isValidbooleanRequired

True when every row passed validation.

fileNamestringRequired

Name of the file that was validated.

rowCountintegerRequired

Number of data rows found in the file.

errorsstring[]

Human-readable validation error messages. Empty when isValid is true.

resultDataImportPreviewRow[]

Rows that passed validation, parsed and normalized. Empty when the file was rejected outright or every row failed.

errorRowsImportValidationErrorRow[]

Rows that failed validation, with their raw values and per-field errors.

fileErrorsstring

A file-level rejection reason (unsupported source, bad format, duplicate headers). Null unless the whole file was rejected.

200

Successful Response

400

The request was invalid.

401

Authentication failed or was missing.

403

The credential is not permitted for this request.

404

The requested resource was not found.

422

The request failed validation.

cURL
POST /imports/validate
-H "Api-Key: ***"
-H "Api-Version: 2026-07-21"
{
"fileName": "certificate.pdf",
"data": "data",
"source": "API",
"direction": "SALE"
}
Response
{
"isValid": false,
"fileName": "certificate.pdf",
"rowCount": 1,
"errors": [
"error"
],
"resultData": [
{
"relatedExternalId": "3f6c2b1e-8a4d-4c2e-9b1f-2d7e5a6c9f10",
"transactionExternalId": "3f6c2b1e-8a4d-4c2e-9b1f-2d7e5a6c9f10",
"status": "PENDING",
"transactionSource": "transaction source",
"date": "2026-07-28T12:00:00Z",
"currency": "AED",
"description": "Annual software subscription",
"customerId": "cust_2mNpQr7Ls8f3k",
"taxId": "12-3456789",
"customerName": "Acme Corp",
"customerEmail": "jane.doe@example.com",
"customerCompanyName": "Acme Corp",
"marketplace": false,
"shipToPhone": "+1 415 555 0100",
"shipToStreetLine1": "123 Main St",
"shipToStreetLine2": "Suite 400",
"shipToCity": "ship to city",
"shipToState": "ship to state",
"shipToPostalCode": "ship to postal code",
"shipToCountry": "ship to country",
"billToPhone": "+1 415 555 0100",
"billToStreetLine1": "123 Main St",
"billToStreetLine2": "Suite 400",
"billToCity": "bill to city",
"billToState": "bill to state",
"billToPostalCode": "bill to postal code",
"billToCountry": "bill to country",
"shipFromPhone": "+1 415 555 0100",
"shipFromStreetLine1": "123 Main St",
"shipFromStreetLine2": "Suite 400",
"shipFromCity": "ship from city",
"shipFromState": "ship from state",
"shipFromPostalCode": "ship from postal code",
"shipFromCountry": "ship from country",
"lineItemId": "3f6c2b1e-8a4d-4c2e-9b1f-2d7e5a6c9f10",
"productExternalId": "3f6c2b1e-8a4d-4c2e-9b1f-2d7e5a6c9f10",
"productName": "Widget",
"productDescription": "Annual software subscription",
"amount": "10.00",
"taxAmount": "10.00",
"quantity": "3",
"exempt": false,
"customerExempt": false,
"transactionType": "SALE",
"operation": "IMPORT",
"discountAmount": "10.00",
"direction": "SALE",
"supplierName": "Acme Corp",
"supplierVatId": "3f6c2b1e-8a4d-4c2e-9b1f-2d7e5a6c9f10",
"supplierCountry": "supplier country",
"invoiceNumber": "123456789",
"lineType": "line type",
"taxRate": "0.082500000",
"expenseCategory": "expense category"
}
],
"errorRows": [
{
"rowNumber": 1,
"row": {},
"errors": [
{
"field": "field",
"message": "Reviewed and approved."
}
]
}
],
"fileErrors": "file errors"
}
Validate a CSV file (2026-07-21) | Kintsugi API Reference