{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/developer/webhooks/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-header","admonition"]},"type":"markdown"},"seo":{"title":"Event ordering","siteUrl":"https://docs.wise.com","projectTitle":"Wise Platform","description":"Learn how to use ordering fields to reconcile the order of webhook events. Wise does not guarantee delivery order, so you should use event-specific timestamp and sequence fields to determine the correct sequence.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"keywords":["webhook ordering","event ordering","occurred_at","step_id"]},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"event-ordering","__idx":0},"children":["Event ordering"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"class":"sub-header"},"children":["Reconcile the order of webhook events."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook event notifications may not arrive in the order they occur due to retries, network conditions, or internal processing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To determine the correct chronological order of events, use the ordering fields available within each event."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Event payloads can have two types of ordering fields:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timestamp"]},": Most event types include a timestamp field that represents when the business event actually happened. Use this to determine the chronological order of events across a resource."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sequence ID"]},": Some event types include a monotonically increasing sequence field you can use to reconcile the order of events within a single transaction.",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["higher"]}," value always means a ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["later"]}," event."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Values may not be contiguous and a gap between numbers does not indicate a missing event."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Currently, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balances#update"]}," is the only event type that supports this (available in v3.0.0+). See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#sequence-ids"},"children":["Sequence IDs"]}," for more details."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A few event types do not yet have a dedicated ordering field. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ordering-fields"},"children":["Ordering fields by event type table"]}," for full details. We aim to improve ordering support across event types over time."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sent_at"]}," field reflects when the notification was dispatched, which may differ from when the event occurred, especially during retries."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For event types that do not yet have a dedicated ordering field, you can use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sent_at"]}," as a best-effort fallback, depending on your requirements."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"id":"how-to-reconcile","level":2,"__idx":1},"children":["How to reconcile event order "]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your application processes events in the order they are received, it may end up with an inaccurate view of the current state of a resource. To avoid this, compare the ordering fields of incoming events to determine when each event actually occurred."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-payloads","__idx":2},"children":["Example payloads"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this example, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2024-06-15T10:30:00.123Z"]},") to determine event order, rather than ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sent_at"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"resource\": { \"type\": \"transfer\", \"id\": 111 },\n    \"current_state\": \"processing\",\n    \"previous_state\": \"incoming_payment_waiting\",\n    \"occurred_at\": \"2024-06-15T10:30:00.123Z\"\n  },\n  \"subscription_id\": \"01234567-89ab-cdef-0123-456789abcdef\",\n  \"event_type\": \"transfers#state-change\",\n  \"schema_version\": \"4.0.0\",\n  \"sent_at\": \"2024-06-15T10:30:01.456Z\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ordering-fields"},"children":["Ordering fields by event type table"]}," for a list of which ordering fields each event type uses."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"timestamp-precision","__idx":3},"children":["Timestamp precision"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Historically, webhook timestamps used second-level precision, and formatting was not always consistent across event types. From schema version ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4.0.0"]},", all timestamps use a consistent ISO 8601 format with millisecond precision:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"2024-06-15T10:30:00.123Z\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This makes it possible to correctly order events that occur within the same second. If using an older schema version, timestamps may only have second-level precision (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2024-06-15T10:30:00Z"]},"), which can make it impossible to distinguish the order of rapid successive events."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For consistent millisecond-precision timestamps, use ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["schema version 4.0.0"]}," or later when creating subscriptions."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"id":"ordering-fields","level":2,"__idx":4},"children":["Ordering fields by event type "]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This table lists the ordering field available for each event type. Use this field to reconcile event order."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Event type"},"children":["Event type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Timestamp ordering field"},"children":["Timestamp ordering field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Sequence field"},"children":["Sequence field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#active-cases"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currently no ordering field available."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account-details-payment#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balances#credit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balances#update"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.step_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["occurred_at"]}," across transactions, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["step_id"]}," within a transaction. Available in v3.0.0+."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balances#account-state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["profiles#verification-state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batch-payment-initiations#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#payout-failure"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["swift-in#credit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["swift#message-received"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cards#transaction-state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["profiles#cdd-check-state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cards#card-status-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cards#card-order-status-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cards#card-production-status-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner-support#case-changed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction-disputes#update"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bulk-settlement#payment-received"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["users#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kyc-reviews#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.resource.updatedAt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Uses camelCase."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cards#3ds-challenge"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["profiles#overdraft-limit-threshold"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currently no ordering field available."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account-details-order#order-state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.modification_time"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["profiles#state-change"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hold-limit-breach#update"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.occurred_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"recommended-approach","__idx":5},"children":["Recommended approach"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Subscribe using schema version ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4.0.0"]}," or later"]}," for consistent millisecond-precision timestamps across all event types."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use each event type's ordering field(s) (as listed in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ordering-fields"},"children":["Ordering fields by event type table"]},")"]}," to determine the true sequence of events.",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Compare timestamp values to sort events chronologically."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balances#update"]},", consider also using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.step_id"]}," to reconcile the order of events within a single transaction. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#sequence-ids"},"children":["Sequence IDs section"]}," for more details."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Handle out-of-order delivery"]},". Events may not arrive in chronological order. Your application should use the ordering fields to reconstruct the correct sequence (for example, by reordering events before processing, updating state only when a newer event is received, or any approach that suits your use case)."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sequence-ids","__idx":6},"children":["Sequence IDs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some event types include a monotonically increasing sequence field that tracks the order of events. Where available, use this field to reliably determine the order of events regardless of timestamp values. A ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["higher"]}," value means the event occurred ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["later"]}," in the sequence."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sequence IDs are not guaranteed to be contiguous and there may be gaps between values. A gap does not indicate a missing event. They should only be used to determine relative order."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Order"},"children":["Order"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Sequence ID"},"children":["Sequence ID"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1st"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["100"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2nd"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["101"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3rd"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["105"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ordering-fields"},"children":["Ordering fields by event type table"]}," for which event types support a sequence field."]}]},"headings":[{"value":"Event ordering","id":"event-ordering","depth":1},{"value":"How to reconcile event order","id":"how-to-reconcile","depth":2},{"value":"Example payloads","id":"example-payloads","depth":3},{"value":"Timestamp precision","id":"timestamp-precision","depth":2},{"value":"Ordering fields by event type","id":"ordering-fields","depth":2},{"value":"Recommended approach","id":"recommended-approach","depth":2},{"value":"Sequence IDs","id":"sequence-ids","depth":2}],"frontmatter":{"seo":{"description":"Learn how to use ordering fields to reconcile the order of webhook events. Wise does not guarantee delivery order, so you should use event-specific timestamp and sequence fields to determine the correct sequence.","keywords":["webhook ordering","event ordering","occurred_at","step_id"],"title":"Event ordering"}},"lastModified":"2026-07-08T14:24:29.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/developer/webhooks/event-ordering","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}