# Race conditions

Webhooks are sent chronologically by Treezor, but Treezor cannot guarantee that your servers will receive them in the same order.

In some situations, you could receive a payin.update before the associated payin.create for instance.

Therefore, your code must not rely on the order in which webhooks are received.

# Identifying the latest webhook

To identify which of two a more webhooks were sent last, you must compare their webhook_created_at attribute with your localy stored values. Most webhook-contained objets also have a createdDate and modifiedDate attribute. You may also use these when they exist.

This is of critical importance for CardTransactions as they go through many steps and only the latest is authoritative. Failure to do so implies displaying outdated and errouneous information to the user.

Updated on: 5/2/2024, 1:13:13 PM