Skip to main content

Import Orders

PUT /v1/order/import

Imports multiple orders from an external source by processing an array of order data. The endpoint validates each order against business rules, applies necessary transformations, and creates new order records in the system. Returns a summary of the import operation including counts of successfully imported orders, any validation errors, and details about orders that could not be processed.

Request Body

[
{
"id": "61bc9c58-6052-4886-8178-55b77f9c9b7f",
"organization_number": "926492543",
"status": "delivered",
"state": "open",
"items": [
{
"amount": "1",
"sku": "123",
"name": "Product A",
"unit": {
"price": "100",
"cost": "90"
},
"price": {
"cost": 90,
"full": 100,
"discount": 0,
"subtotal": 100,
"tax": 0,
"total": 100
},
"discount": "0"
},
{
"amount": "2",
"sku": "124",
"name": "Product B",
"unit": {
"price": "200",
"cost": "190"
},
"price": {
"cost": 380,
"full": 400,
"discount": 0,
"subtotal": 400,
"tax": 0,
"total": 400
},
"discount": "0"
}
],
"price": {
"cost": 470,
"full": 500,
"discount": 0,
"subtotal": 500,
"tax": 0,
"total": 500
},
"integrations": [
{
"objectId": "13124",
"properties": {
"type": "historical"
}
}
],
"delivery": {
"address": {
"street": "Street",
"city": "Oslo",
"country": "Norway",
"zip": "1234"
}
},
"date": {
"delivery": "2023-12-31T00:00:00.000Z",
"order": "2023-12-20T00:00:00.000Z"
},
"tenant": "6065a9eb6783e09eb34bb844",
"account": "6421c6893c4e0f0b73edabd7",
"account_details": {
"status": {
"active": true
},
"address": {
"postal": {
"line2": "",
"street": "Vestsidevegen 221",
"zip": "3522",
"city": "BJONEROA",
"country": "Norge",
"editable": true,
"_id": "6527c48d0baaf4969fb855b3"
},
"official": {
"line2": "",
"street": "Vestsidevegen 221",
"zip": "3522",
"city": "BJONEROA",
"country": "Norge",
"editable": true,
"_id": "6527c48d0baaf4969fb855b2"
}
},
"email": {
"default": "noreply@zaveit.no"
},
"_id": "6421c6893c4e0f0b73edabd7",
"number": "926492543",
"__v": 0,
"bankaccount": [],
"contacts": [],
"country": "NO",
"created": "2023-03-27T16:38:33.920Z",
"integrations": [],
"name": "ZaveIT",
"primaryuser": "1065a9eb6783e09eb34bb810",
"tenant": "6065a9eb6783e09eb34bb844",
"type": "customer",
"updated": "2023-10-12T10:03:57.672Z",
"id": "6421c6893c4e0f0b73edabd7"
},
"referenceId": null
}
]