Skip to main content

Import Accounts

PUT /v1/account/import

Bulk upserts accounts from an external source. Accepts a batch and processes each item independently (validate, create or update). Returns a per-item result in a settled-style array where each entry includes a status of "fulfilled" or "rejected". Fulfilled items return the saved account resource; rejected items return a failure reason.

Request Body

[
{
"id": "id-1",
"name": "Example Org",
"email": { "default": "contact@example.com" },
"country": "NO",
"number": "1001",
"address": {
"postal": { "city": "Oslo", "country": "NO" },
"delivery": { "city": "Oslo", "country": "NO" }
}
},
{
"id": "id-2",
"name": "Sample Ltd",
"email": { "default": "info@example.com" },
"country": "IN",
"number": "1002",
"address": {
"postal": { "city": "Mumbai", "country": "IN" },
"delivery": { "city": "Mumbai", "country": "IN" }
}
}
]

Response Example

[[
{
"status": "fulfilled",
"value": {
"status": { "active": true },
"type": "customer",
"number": "1001",
"country": "NO",
"name": "Example Org",
"address": { "postal": { "city": "Oslo", "country": "NO" } },
"email": { "default": "contact@example.com" },
"_id": "record-id-1",
"id": "record-id-1"
}
},
{
"status": "fulfilled",
"value": {
"status": { "active": true },
"type": "customer",
"number": "1002",
"country": "IN",
"name": "Sample Ltd",
"address": { "postal": { "city": "Mumbai", "country": "IN" } },
"email": { "default": "info@example.com" },
"_id": "record-id-2",
"id": "record-id-2"
}
}
]