Перейти к содержимому

Create or update a batch of orders by external id

POST
/api/v1/integration/orders/sync/bulk
curl --request POST \
--url https://example.com/api/v1/integration/orders/sync/bulk \
--header 'Content-Type: application/json' \
--data '[ { "externalId": "example", "customId": "example", "price": 1, "planDeliveryPeriod": { "startDate": "2026-04-15T12:00:00Z", "endDate": "2026-04-15T12:00:00Z" }, "planPickupPeriod": { "startDate": "2026-04-15T12:00:00Z", "endDate": "2026-04-15T12:00:00Z" }, "addressFrom": { "line": "example", "lat": 1, "long": 1, "details": "example", "commentary": "example", "domofon": "example", "flat": "example", "floor": "example", "porch": "example" }, "addressTo": { "line": "example", "lat": 1, "long": 1, "details": "example", "commentary": "example", "domofon": "example", "flat": "example", "floor": "example", "porch": "example" }, "appType": "example", "volume": 1, "weight": 1, "priority": 1, "deliveryPrice": 1, "additionalDetails": "example", "details": "example", "assembled": true, "statusGroup": "example", "type": "Delivery", "relatedToOrderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "lines": [ { "code": "example", "name": "example", "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "warehouseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "requiredSkills": [ "example" ], "weight": 1, "volume": 1, "dimensions": { "length": 1, "width": 1, "height": 1 }, "priority": 1, "requestedQty": 1, "unitPrice": 1, "role": "Deliver" } ], "client": { "name": "example", "phone": "example", "email": "example" }, "assignedDriverId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assignedVehicleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]'

Each item is applied on its own; a failing item does not stop the rest. Returns the created, updated and restored counts together with a per-item error list.

Media typeapplication/json
Array<object>

An order as a source system sends it. The external id decides whether this creates a new order or updates the one already carrying that id.

object
externalId
required

The id your system knows this order by. Required, and the key the platform matches on: sending the same id again updates the same order.

string
customId
required

Your own reference for the order. Stored and returned unchanged, and available as a filter on the order list.

null | string
price
required

Price of the goods. Cannot be negative.

number format: double
planDeliveryPeriod
required
One of:
null
planPickupPeriod
required
One of:
null
addressFrom
required
One of:
null
addressTo
required
One of:
null
appType
required

Free-form classification from your system. Stored and returned unchanged; the platform does not interpret it.

null | string
volume
required

Volume of the whole order. Leave it out to have the platform derive it from the lines instead.

null | number format: double
weight
required

Weight of the whole order. Leave it out to have the platform derive it from the lines instead.

null | number format: double
priority
required

Relative priority of the order.

null | integer format: int32
deliveryPrice
required

What the delivery itself costs, apart from the goods. Stored and returned unchanged.

null | number format: double
additionalDetails
required

Free-form notes from your system.

null | string
details
required

Free-form notes from your system.

null | string
assembled
required

Whether the goods are already assembled. Stored and returned unchanged.

null | boolean
statusGroup
required

Free-form grouping from your system. Stored and returned unchanged; it is not the order’s status.

null | string
type
required
One of:
null
relatedToOrderId
required

The order this one is raised against, for a Return or a Rebox.

null | string format: uuid
lines
required

The OrderLines the order is made of. Defaults to none.

Array<object> | null

One OrderLine of an order sent in from a source system.

object
code
required

Your code for the goods.

string
name
required

Human-readable name of the goods.

string
productId
required

Id of the product this line refers to.

string format: uuid
warehouseId
required

Id of the Warehouse the goods are taken from.

string format: uuid
requiredSkills
required

Skills a Driver must hold to handle this line. Defaults to none.

Array<string> | null
weight
required

Weight of ONE unit, not of the whole line.

null | number format: double
volume
required

Volume of ONE unit, not of the whole line.

null | number format: double
dimensions
required
One of:
null
priority
required

Relative priority of the line.

null | integer format: int32
requestedQty
required

How many units are asked for.

integer format: int32
unitPrice

Price of one unit.

null | number format: double
role
One of:
null
client
One of:
null
assignedDriverId

Driver this order must go to. Send it together with the vehicle: planning then keeps that pair and only routes the stops. Leave both out to let planning choose.

null | string format: uuid
assignedVehicleId

Vehicle this order must go on, sent together with the Driver.

null | string format: uuid

OK

Media typeapplication/json

What a bulk order sync did. Items are handled independently: a failure on one does not stop the rest.

object
created
required

How many orders were created.

integer format: int32
updated
required

How many existing orders were updated.

integer format: int32
restored
required

How many archived orders were brought back.

integer format: int32
errors
required

One entry per item that was rejected, empty when every item succeeded.

Array<object>

Why one item of a bulk sync was rejected. The four field-error members match the shape a single-order call returns for a validation failure.

object
externalId
required

The external id of the item that failed, so it can be matched back to the request.

string
index
required

The item’s zero-based position in the request.

integer format: int32
code
required

The error code.

string
field
required

The field the error is about, or null when it is not about one field.

null | string
value
required

The value that was rejected, or null.

null | string
message
required

A human-readable explanation.

string
Examplegenerated
{
"created": 1,
"updated": 1,
"restored": 1,
"errors": [
{
"externalId": "example",
"index": 1,
"code": "example",
"field": "example",
"value": "example",
"message": "example"
}
]
}

Validation failed

Media typeapplication/problem+json

The body of a 400 response, served as application/problem+json. It follows the RFC 9457 problem-details shape: type, title, status and detail are the standard members, and errors is an extension that lists the offending fields.

object
type
required

A stable, machine-readable code for the error. Branch on this rather than on the wording of the title or the detail.

string
title
required

A short label for the kind of failure, such as Validation failed.

string
status
required

The HTTP status code of the response, which for this body is 400.

integer format: int32
detail
required

A human-readable explanation of this particular failure, or null.

null | string
errors

The fields the request was rejected over, one entry each. Omitted entirely when the failure carries no field-level context, so a 400 can arrive without this member.

Array<object> | null

One field the request was rejected over.

object
field
required

The name of the offending field, spelled as the request body spells it.

string
code
required

A stable, machine-readable code for this field’s failure.

string
value
required

The rejected value. Always present, and null when it was not safe to echo back.

null | string
message
required

A human-readable explanation of what is wrong with the field.

string
overridable

Set only by the dispatcher application’s manual planning operations — integration endpoints never set it. True when every problem in this refusal is a tenant-policy refusal the operator may override by re-sending the same request with force: true. Omitted otherwise.

null | boolean
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"code": "example",
"value": "example",
"message": "example"
}
],
"overridable": true
}

Missing or invalid credentials

Authenticated, but the role or scope does not allow this

Not found

Media typeapplication/problem+json

RFC 9457 problem body returned on every failure. type carries a stable machine-readable error code (see docs/api/error-codes.yaml), title a short human summary, status the HTTP status, detail the specific message.

object
type
null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Conflict

Media typeapplication/problem+json

RFC 9457 problem body returned on every failure. type carries a stable machine-readable error code (see docs/api/error-codes.yaml), title a short human summary, status the HTTP status, detail the specific message.

object
type
null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Rate limit exceeded, or an Idempotency-Key request is still in flight; retry after the Retry-After header

Media typeapplication/problem+json

RFC 9457 problem body returned on every failure. type carries a stable machine-readable error code (see docs/api/error-codes.yaml), title a short human summary, status the HTTP status, detail the specific message.

object
type
null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Unexpected error

Media typeapplication/problem+json

RFC 9457 problem body returned on every failure. type carries a stable machine-readable error code (see docs/api/error-codes.yaml), title a short human summary, status the HTTP status, detail the specific message.

object
type
null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}