# How Xero to Logistaas works

> Step-by-step payment.received handling from Xero through enrich and create_payment in Logistaas.

## Trigger

An invoice update / payment received event arrives from Xero with enough context to identify the payment.

## Enrichment

OnDraft maps the Xero payload to Logistaas field requirements before any write.

## Idempotency

Before create, the process checks for an existing payment with serial **`XERO-{id}`**.  
A **422 already-exists** response from Logistaas is treated as success.

## Recording

Each run is stored so operators can answer “what happened to payment X?” without opening three systems.

See the visual flow on the [flagship page](/integrations/logistaas/xero/).
