/customer-items/batch
Create or update many customer item numbers in one call
Creates and updates up to 500 customer items per call, across customers — the customer's own number and description for one of our items (a cross reference). Each row is identified by
customerNumber
and
itemNumber
: a customer has one active customer item per item.
Visa hela beskrivningen
One that exists gets the fields the row carries; a field that is omitted or
null
is left as it is — this endpoint never clears a field. One that does not exist is created, and then
customerItemNo
is required. Rows go through the same rules as the MCP tool
action_UpsertCustomerItems
and the app. The HTTP status describes the request, not the rows: a well-formed batch always answers 200, and every row carries its own
outcome
(
created
,
updated
or
failed
) plus an
error
when it failed. A bad row never blocks the rest — re-send only the failed rows. Row error codes include BulkUpsert.ParentNotFound (no customer or item with that number), BulkUpsert.RequiredForNew (a new row without customerItemNo), BulkUpsert.DuplicateInBatch (the same customer and item twice) and, with
mode
set, BulkUpsert.AlreadyExists or BulkUpsert.NotFound.
mode
is
upsert
(default),
create
or
update
. An
Idempotency-Key
is required like on every POST under /preview.
Body krävs
| Fält | Typ | Beskrivning |
|---|---|---|
items
Krävs
|
BatchUpsertCustomerItemsRow[] | The rows to create or update. At most 500 per call, across customers. |
mode
|
enum |
upsert
(default) creates missing customer items and updates existing ones,
create
fails a row whose customer item already exists,
update
fails a row whose customer item does not.
Upsert
Create
Update
|
Svar
BatchUpsertCustomerItemsResponse
| Fält | Typ |
|---|---|
createdCount
|
integer |
failedCount
|
integer |
results
|
BatchUpsertCustomerItemsRowResult[] · nullable |
updatedCount
|
integer |
ProblemDetails
The batch is empty (BulkUpsert.Empty) or has more than 500 rows (BulkUpsert.TooManyRows), a row lacks customerNumber or itemNumber, or mode is unknown.
| Fält | Typ |
|---|---|
detail
|
string · nullable |
instance
|
string · nullable |
status
|
integer · nullable |
title
|
string · nullable |
type
|
string · nullable |
Standardfel:
401
403
Felhantering
Exempel
curl -X POST "https://api.fluit.cloud/preview/customer-items/batch" \
-H "X-Api-Key: fluit_live_sk_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d @body.json
{
"items": [
{
"customerDescription": "HDMI 2 m",
"customerItemNo": "K-4711",
"customerNumber": "10001",
"itemNumber": "670-00001"
},
{
"customerItemNo": "99-120",
"customerNumber": "10002",
"itemNumber": "670-00001"
}
]
}
{
"createdCount": 42,
"failedCount": 42,
"results": [
{
"customerNumber": "CUST-001",
"error": {
"code": "string",
"detail": "string"
},
"index": 42,
"itemNumber": "WIDGET-A",
"outcome": "string"
}
],
"updatedCount": 42
}
Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.