Import a batch of records
Imports up to 200 items, customers or vendors per call, already mapped to the target field names. Set dryRun to validate and check for duplicates without writing anything. Existing records are matched by item ID, customer email or vendor code.
How to use it
- Build records keyed by target field names, using List importable fields or Suggest a column mapping for an import file, and apply any suggested transforms on your side.
- Send up to 200 records per call with entityType, dedupeMode and startIndex; split larger files into batches.
- Run once with dryRun true to see WOULD_CREATE / WOULD_UPDATE / WOULD_SKIP and errors, then repeat with dryRun false.
- On a real run, item brands, departments, categories, sizes, colours and styles named in the records are created if they do not exist yet.
- Check each result: rows marked FAILED were not saved and carry an error; the other rows are saved independently.
BearerAuthAuthorizationBearer <JWT>application/json- body
entityType*stringType of record being imported: ITEM, CUSTOMER or VENDOR. All records in one call must be the same type.
"ITEM""CUSTOMER""VENDOR"dedupeMode*stringWhat to do when a record already exists (items by item code, customers by email, vendors by vendor code): SKIP_EXISTING (default) or UPDATE_EXISTING.
"SKIP_EXISTING""UPDATE_EXISTING"dryRun*booleanSet to true to validate and check duplicates without saving anything. Defaults to false.
startIndex*integerPosition of the first record of this batch in the source file, so row numbers stay stable across batches. Defaults to 0.
int32records*array<>1 to 200 records, each an object of target field name to value (field names from List importable fields).
0 <= items <= 200OK
*/*- response
status*stringOutcome of the request: SUCCESS when it worked; errors return an error status with the reason in message.
message*stringShort human-readable message describing the outcome.
data?The import outcome: counts per result and one result per submitted record.
curl -X POST 'https://beta.iotoms.com/api/v1/ai/import/execute' \ -H 'Content-Type: application/json' \ -d '{ "entityType": "ITEM", "dedupeMode": "SKIP_EXISTING", "dryRun": true, "startIndex": 0, "records": []}'{ "status": "string", "message": "string", "data": { "dryRun": true, "created": 0, "updated": 0, "skipped": 0, "failed": 0, "results": [ { "index": 0, "status": "CREATED", "entityId": "string", "error": "string" } ] }}