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

Create or update an order by external id

POST
/api/v1/integration/orders/sync
curl --request POST \
--url https://example.com/api/v1/integration/orders/sync \
--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" }'

Answers 201 when the external id is new and 200 when an existing order was updated. Re-sending an order that was archived or cancelled brings it back: the outcome is Restored, the order keeps its original id and short id, and its status returns to New.

Media typeapplication/json

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 single order sync did.

object
orderId
required

Id of the order the external id resolved to.

string format: uuid
outcome
required

Created when the external id was new, Updated when an existing active order was changed, Restored when the sync brought an order back that was archived or cancelled. A restored order keeps its original id and short id, and returns to the New status.

Allowed values: Created Updated Restored
shortId
required

Human-readable identifier of the form ORD-XXXXX, unique within the tenant.

string
type
required

Kind of order: Delivery, Pickup, Return or Rebox.

Allowed values: Delivery Pickup Return Rebox
Example
{
"outcome": "Created",
"type": "Delivery"
}

Created

Media typeapplication/json

What a single order sync did.

object
orderId
required

Id of the order the external id resolved to.

string format: uuid
outcome
required

Created when the external id was new, Updated when an existing active order was changed, Restored when the sync brought an order back that was archived or cancelled. A restored order keeps its original id and short id, and returns to the New status.

Allowed values: Created Updated Restored
shortId
required

Human-readable identifier of the form ORD-XXXXX, unique within the tenant.

string
type
required

Kind of order: Delivery, Pickup, Return or Rebox.

Allowed values: Delivery Pickup Return Rebox
Example
{
"outcome": "Created",
"type": "Delivery"
}

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"
}