Discuss a project

QQDEV · KYRGYZSTAN · REMOTE

An older event arrived late. Keep the current order status

Check the order of changes so a delayed message cannot send a collected order back to packing.

Published

2 min15

Illustrative example. The warehouse packs an order and later hands it to the customer. The collection message arrives immediately. The packing message is delayed and arrives last. If the integration applies changes in delivery order, a collected order will be shown as being packed again.

Decide how to order changes

If the source system provides an increasing order version, store the last applied version alongside the order number. When an older version arrives, keep the current status and log why. Compare versions within the same order and source.

If you only have a timestamp, establish what it represents: the event, the record being saved or the message being received. Receipt time shows when the other system saw the message. Convert event timestamps to a common time scale and define how to handle identical or missing values.

Account for real changes after collection

Check who can correct an order and what new event the correction creates. For example, a return recorded after collection is a separate fact. Do not automatically discard it because the order was completed. If the version is uncertain, read the source system's current state before changing the record.

An integration with Bitrix24 can request the current record by ID. The documented response example includes the record's update time. Check whether it fits your purpose: a comment edit and a status change can mean different things to the integration. Bitrix24 documentation on reading a CRM record.

Reproduce the delay

On a test order, send collection first and packing second. Check the current status, processing log and notifications. The old event should not trigger actions again. Then send a new confirmed correction. If the existing system remains the source of orders, you can test the scenario without replacing it. Show QQDev an anonymised sequence like this if you plan to connect it to CRM. Discuss Bitrix24 implementation.

← All blog posts