Skip to content

Order retrieval & sync

Retrieving orders is a two-step process: first ask for matching Ids, then request the full data for those Ids.

SituationCommand
Find which orders match a filter (date range, client, operator)RequestOrdersNormalIds
Get the full XML for specific known IdsRequestOrdersNormal
Poll for only what changed since your last checkRequestOrdersNormalIds with SequenceMinimum
Create a new orderStoreOrdersNormal instead
Change an existing orderStoreOrdersNormal instead
<?xml version="1.0" encoding="windows-1252"?>
<EoCustomLinkRequestOrdersNormalIds Type="TEoCustomLinkRequestOrdersNormalIds">
<Nested>False</Nested>
<Filter Type="TEoFilterOrdersNormal">
<PeriodBegin>2026-07-01T00:00:00</PeriodBegin>
<PeriodEnd>2026-07-31T00:00:00</PeriodEnd>
<ClientNo>110</ClientNo>
<OperatorId>-1</OperatorId>
</Filter>
</EoCustomLinkRequestOrdersNormalIds>
Filter fieldMeaning
PeriodBegin / PeriodEndInclusive date range. Defaults to today if omitted.
ClientNoClient’s database key. -1 = no client filter.
OperatorIdSingle Id or CSV list (e.g. 130,131,152). -1 = no operator filter.
KeysExplicitAsCsvExplicit order Ids instead of a period/client/operator filter.
SequenceMinimumOnly return orders with Sequence at or above this value — see incremental sync below.
IgnShowAlwaysWhether always-visible (ShowAlways) orders bypass the period/client/operator filters. Unrelated to SequenceMinimum/SequenceMaximum, which are always applied regardless of this flag. Per the schema, normally True for retrieval (default is False).

The response returns matching Ids plus a SequenceMaximum:

<?xml version="1.0" encoding="windows-1252"?>
<EoCustomLinkResponseOrdersNormalIds Type="TEoCustomLinkResponseOrdersNormalIds">
<Data Type="TEoKeyIntList">
<SequenceMaximum>7086</SequenceMaximum>
<_TEoListBase_Items>
<EoKeyInt Type="TEoKeyInt"><Id>349</Id></EoKeyInt>
<EoKeyInt Type="TEoKeyInt"><Id>371</Id></EoKeyInt>
</_TEoListBase_Items>
</Data>
</EoCustomLinkResponseOrdersNormalIds>
<?xml version="1.0" encoding="windows-1252"?>
<EoCustomLinkRequestOrdersNormal Type="TEoCustomLinkRequestOrdersNormal">
<Nested>False</Nested>
<Filter Type="TEoFilterOrdersNormal">
<KeysExplicitAsCsv>349,371</KeysExplicitAsCsv>
</Filter>
</EoCustomLinkRequestOrdersNormal>

The full order XML returned here uses the same TEoOrderMx shape as the store request — see Key order fields on the Order intake page for the field table. Fields unique to reading an order (not meaningful to set):

FieldTypeDescription
AmountdecimalRead-only. Live total of the order’s sold articles (ArticlesSell) — recalculated continuously as the order changes, not just once invoiced. Stops updating only once the order reaches its final, locked invoice status.
DistancedecimalRead-only. Total distance in km, calculated from the route (see AddressStart/AddressEnd below).
AddressStart / AddressEndaddressOptional. Not just a mirror of the first/last task — if set, these addresses are added as the actual start/end leg of the order’s route for distance/duration calculation, instead of starting and ending at the first and last task. Custom Link callers can set these explicitly; otherwise MendriX fills them from the client’s or administration’s configured default depot address (if the client has that default address configured).

Sequence is a database-wide counter incremented on every committed change; everything changed in one transaction shares the new value. Once you have a SequenceMaximum from a prior call, pass it back as SequenceMinimum (one higher) to get only what changed since:

<Filter Type="TEoFilterOrdersNormal">
<PeriodBegin>2026-07-01T00:00:00</PeriodBegin>
<PeriodEnd>2026-07-31T00:00:00</PeriodEnd>
<ClientNo>110</ClientNo>
<OperatorId>-1</OperatorId>
<SequenceMinimum>7087</SequenceMinimum>
</Filter>

Scenario: first poll (cold start). Request order Ids with a period filter and no SequenceMinimum. Store the returned SequenceMaximum (e.g. 7086) as your local high-water mark.

Scenario: incremental poll. On your next run, add <SequenceMinimum>7087</SequenceMinimum> (one higher than your stored value) to the same filter. Only orders changed since your last poll come back, each with a new SequenceMaximum — update your stored value to the new maximum before your next run.

Since MendriX 2026.2, an order matches a PeriodBegin/PeriodEnd filter when any of its tasks is active at any point in the period — not only when a task moment falls inside it. A task requested from 10 March to 25 March is returned by a filter for 15-20 March, even though neither endpoint falls in that window, because the task is active throughout it.

If your integration depends on the pre-2026.2 point-in-period behavior, add the compatibility switch:

<Filter Type="TEoFilterOrdersNormal">
<PeriodBegin>2026-07-01T00:00:00</PeriodBegin>
<PeriodEnd>2026-07-31T00:00:00</PeriodEnd>
<UseLegacyOrderFilterPeriodMatching>True</UseLegacyOrderFilterPeriodMatching>
</Filter>

Full details: Custom Link: rules of engagement.

  • Sequence is assigned synchronously with the store — there is no background-process lag; a sequence-filtered read immediately after a store reflects it right away.
  • IgnShowAlways is unrelated to Sequence filtering — SequenceMinimum/SequenceMaximum are always applied to the result set regardless of this flag. IgnShowAlways only controls whether always-visible (ShowAlways) orders bypass the period/client/operator filters; per the schema, it should normally be set True for retrieval (default is False).
  • The default period is today if PeriodBegin/PeriodEnd are omitted — don’t assume “no period” means “all orders.”