Skip to content

Order intake

StoreOrdersNormal creates a new order when you send a negative OrderId/Id. The same command also updates existing orders when you send a positive Id — for that retrieve-then-store workflow, see Order update.

SituationCommand
Create a brand-new orderStoreOrdersNormal with a negative OrderId/Id
Instantiate order(s) from a recurring templateActivateOrderTemplate
Change an existing orderSee Order update instead
Just read an order, no changesSee Order retrieval & sync instead

Set OrderId/Id to any negative number — this tells Custom Link to insert a new record. New orders are exempt from the retrieve-before-store rule that applies to updates.

A realistic order is built from three separate lists hung off the order: Goods (the packages/cargo), Tasks (the pickup/delivery stops), and GoodsToTasks (which good moves through which task). All three are needed — a Tasks-only payload with no Goods/GoodsToTasks creates an order with stops but no cargo recorded against it:

<?xml version="1.0" encoding="windows-1252"?>
<EoCustomLinkStoreOrdersNormal Type="TEoCustomLinkStoreOrdersNormal">
<ApplyImportSettings>1</ApplyImportSettings>
<Data Type="TEoOrderMxList">
<_TEoListBase_Items>
<EoOrderMx Type="TEoOrderMx">
<OrderId Type="TEoKeyIntInfraMx"><Id>-1000</Id></OrderId>
<ClientNumber>1001</ClientNumber>
<Reference>PO-2026-00042</Reference>
<Contact>Jan de Vries</Contact>
<Goods Type="TEoGoodMxList">
<_TEoListBase_Items>
<EoGoodMx Type="TEoGoodMx">
<GoodId Type="TEoKeyIntInfraMx"><Id>-1</Id></GoodId>
<Barcode>MXG00000087</Barcode>
<Comments>2 pallets general cargo</Comments>
<Parts>2.0</Parts>
<Weight>480.0</Weight>
</EoGoodMx>
</_TEoListBase_Items>
</Goods>
<Tasks Type="TEoTaskMxList">
<_TEoListBase_Items>
<!-- Pickup task -->
<EoTaskMx Type="TEoTaskMx">
<TaskId Type="TEoKeyIntInfraMx"><Id>-100</Id></TaskId>
<TaskTypeIdEx>1</TaskTypeIdEx>
<Address Type="TEoAddress">
<Name>Acme Warehouse</Name>
<Street>Havenweg</Street>
<Number>12</Number>
<PostalCode>3011 XA</PostalCode>
<Place>Rotterdam</Place>
<CountryCode>NL</CountryCode>
</Address>
<ContactName>Jan de Vries</ContactName>
<Requested Type="TEoDateTimeWindow">
<DateTimeBegin>2026-07-22T08:00:00</DateTimeBegin>
<DateTimeEnd>2026-07-22T12:00:00</DateTimeEnd>
</Requested>
<Instructions>Call on arrival</Instructions>
<ReferenceYour>PICKUP-42</ReferenceYour>
</EoTaskMx>
<!-- Delivery task -->
<EoTaskMx Type="TEoTaskMx">
<TaskId Type="TEoKeyIntInfraMx"><Id>-200</Id></TaskId>
<TaskTypeIdEx>2</TaskTypeIdEx>
<Address Type="TEoAddress">
<Name>Beta Distribution</Name>
<Street>Industrieweg</Street>
<Number>88</Number>
<PostalCode>5651 GH</PostalCode>
<Place>Eindhoven</Place>
<CountryCode>NL</CountryCode>
</Address>
<Requested Type="TEoDateTimeWindow">
<DateTimeBegin>2026-07-22T14:00:00</DateTimeBegin>
<DateTimeEnd>2026-07-22T17:00:00</DateTimeEnd>
</Requested>
<ReferenceYour>DELIVERY-42</ReferenceYour>
</EoTaskMx>
</_TEoListBase_Items>
</Tasks>
<GoodsToTasks Type="TEoGoodToTaskMxList">
<_TEoListBase_Items>
<EoGoodToTaskMx Type="TEoGoodToTaskMx">
<GoodId Type="TEoKeyIntInfraMx"><Id>-1</Id></GoodId>
<TaskId Type="TEoKeyIntInfraMx"><Id>-100</Id></TaskId>
</EoGoodToTaskMx>
<EoGoodToTaskMx Type="TEoGoodToTaskMx">
<GoodId Type="TEoKeyIntInfraMx"><Id>-1</Id></GoodId>
<TaskId Type="TEoKeyIntInfraMx"><Id>-200</Id></TaskId>
</EoGoodToTaskMx>
</_TEoListBase_Items>
</GoodsToTasks>
</EoOrderMx>
</_TEoListBase_Items>
</Data>
</EoCustomLinkStoreOrdersNormal>

The same good (GoodId=-1) is linked to both tasks here — it’s picked up at the first task and delivered at the second. This is the normal shape for a simple pickup-and-deliver order: one GoodsToTasks entry per (good, task) pair the good passes through, not one entry per good. See Linking goods to tasks below for the full field reference and more scenarios (multiple goods, goods that touch only one task, what happens if you forget the link).

StoreResultList returns the new positive Id MendriX assigned, paired with the negative Id you sent — see the full worked round trip in the order intake example.

Goods (the packages/cargo on an order) and tasks (the pickup/delivery stops) are declared as two separate lists on the order — Goods (TEoGoodMxList) and Tasks (TEoTaskMxList). Neither list says which good moves through which task. That link is a third list, GoodsToTasks (TEoGoodToTaskMxList), where each EoGoodToTaskMx entry is just a GoodId/TaskId pair.

FieldTypeDescription
GoodIdkeyNegative = insert, positive = update.
Barcodestring (max 100)Barcode without start/end characters.
Commentsstring (max 50)Description of the good’s contents.
PartsdecimalNumber of parts this good consists of.
WeightdecimalWeight of all parts, in kg.
Height / Width / DepthdecimalDimensions per part, in cm.
VolumedecimalCalculated automatically from dimensions unless VolumeManual=True.
PackingpackingPacking type/name (e.g. “pallet”, “envelope”).
CharacteristicsRestrictedCSV of intGood characteristics — 2 no-neighbor-delivery, 4 ADR, 18 age 18+, 40 cool, 41 freeze, 42 dry/ambient, 43 deep freeze. Only one temperature-range characteristic (40/41/42/43) takes effect; the last one listed wins if more than one is given.
ADR / UNNumberstring / intDangerous-goods classification, if applicable.
FieldTypeDescription
TaskIdkeyNegative = insert, positive = update.
TaskTypeIdExintThe task type — 1 Get/pickup, 2 Bring/delivery, plus 3 swap, 4 return, and others. Set this field, not TaskTypeId (see caution below).
AddressTEoAddressName/street/postal code/place/country for this stop.
RequestedTEoDateTimeWindowThe client’s requested time window for this task; narrow it as the actual moment approaches.
ContactNamestring (max 100)Contact person for this task, distinct from the order-level Contact.
ConnectivityTEoConnectivityContact details for this task. The type also has a Web field, but the schema documents only Email/Fax/Mobile/Phone as supported at the task level.
Instructionsstring (max 1000)Free-text instructions for the operator performing the task.
HandlingTimeInMinutesintDuration of the task in minutes. MendriX calculates this automatically unless HandlingTimeManual=True.
ReferenceOur / ReferenceYourstring (max 100)Internal reference (yours) vs. the client’s own reference for this task.
OperatorId / VehicleId / MaterialIdkeyAssign a specific operator, vehicle, or material (e.g. coolbox, trailer) to this task.

The example above already shows the normal shape — one good linked to both a pickup and a delivery task. The scenarios below cover the variations and the failure mode:

Scenario: a good that only touches one task. If a good is, say, collected and consumed at a single task (not moved between two), it still needs at least one GoodsToTasks entry linking it to that task — a good with zero GoodsToTasks entries is not associated with any stop on the order.

Scenario: multiple goods across multiple tasks. Each good needs its own GoodsToTasks entry for every task it passes through. Two goods each moving through the same two tasks means four GoodsToTasks entries total (good 1 → task A, good 1 → task B, good 2 → task A, good 2 → task B) — there’s no shorthand for “all goods to all tasks.”

Scenario: forgetting the link (what goes wrong). You send Goods with one new good (GoodId=-1) and Tasks with one new task (TaskId=-100), but omit GoodsToTasks entirely. The store succeeds — StoreResult=srInserted for the order — but the good has no task association in MendriX. Nothing in the response signals this; the only way to catch it is to retrieve the order afterward and check that GoodsToTasks came back non-empty.

Scenario: create an order and get back its assigned Id. Send StoreOrdersNormal with OrderId/Id set to -1. The response’s EoStoreResult has IdOld=-1 and Id=<the new positive Id> with StoreResult=srInserted — use that Id for any follow-up retrieval or update.

The fields most integrators read or set on an order, beyond the nested Tasks/Goods/ArticlesSell lists already shown above:

FieldTypeDescription
OrderIdkeyNegative = insert, positive = update (requires prior retrieval).
ClientId / ClientNumberkey / stringSet one, not both. ClientNumber is resolved to a ClientId automatically.
Contactstring (max 100)The person who gave the order — distinct from a task’s ContactName.
Referencestring (max 100)Your order reference.
MomentdateTimeDate/time of entry.
Notesstring (max 250)Free-text notes on the order.
OrderTypeint100 = Concept, 200 = Offer, 400 = Normal (default if omitted).
ProductIdAutomaticArticlesbooleanTrue adds and calculates this order’s product’s automatic articles for the client’s specific prices. Leave False if you’re specifying articles yourself via ArticlesSell.
ConfirmedbooleanConfirmed for driver/vehicle. Default True.
CancelledbooleanOrder is cancelled but still calculated/invoiced.
InvoiceStatusIdint0 open, 1 never invoice, 2 ready to invoice, 10 on invoice, 20 locked on invoice.
VehicleRequirementsstring (CSV)Requirements for the vehicle(s)/material, e.g. REFRIGERATION, TAIL_LIFT, ADR. Replaces the full set when included.
OperatorRequirementsstring (CSV)Requirements for the operator(s), e.g. DRIVERS_MATE, ADR. Replaces the full set when included.
AmountInsureddecimalAmount this order is insured for.
ExternalDonebooleanMarks this external order as accepted by planning. Requires ExternalSource.
ExternalSourceintSource of this external order. 0 regular, 1 WorldLink, 2 imported.

Amount and Distance are read-only — MendriX calculates these; sending them has no effect. AddressStart/AddressEnd are not read-only — Custom Link callers can set them explicitly to define the actual start/end leg of the order’s route; if omitted, MendriX fills them from the client’s or administration’s configured default address. There is no AmountVat on a plain order — VAT is calculated at invoice time, not order time. See Response fields on the Order retrieval & sync page for the full explanation of these fields.

See GdxEoStructures.xsd for the complete field list, including less commonly used fields.

Every store command — not just orders — returns the same shape, a list of EoStoreResult items:

FieldTypeDescription
IdintThe database Id of the stored item (the new positive Id for an insert).
IdOldintThe Id you sent in the request (often negative, for a new item).
RowsAffectedintNumber of database rows affected.
StoreResultenumsrInserted, srUpdated, srError, srNone, srFailed.
StoreDescriptionstringTextual detail, especially for srError — often the exception message.
ErrorTypeenumetNone, etStructural, etIncidental, etUnknown. Retry requests with etIncidental errors; don’t retry etStructural unchanged.

Match IdOld back to the negative Id you sent to correlate results with your original request, the same way ReferenceYour/Reference correlate task-level data — see the order intake example.

Rather than hand-building XML for each order, you can instantiate orders from a recurring order template using ActivateOrderTemplate. The command matches a template by task type and address, checks if the template’s time window contains your requested moment, and if the template repeats on that day, activates it — creating real order(s) from the template. If no matching template is found, no orders are created. The response is EoStoreResultList, just like a regular store.

Template activation is useful for recurring pickups or deliveries where the order structure stays the same and you only need to trigger it for a specific date and time.