On Partial Results (Experience Closed)

View as Markdown
Triggered when the user is done and the widget closes, but **one or more sources are still working**. Some administrations do not answer in real time — the CIRBE report from the Banco de España is the usual case — so the session keeps running in the background instead of holding your user in front of a spinner. This event hands you **everything retrieved so far**. <Warning title="This data is PARTIAL. It is not the final result."> The payload of this event always carries **`is_closed: false`** — that field is how you tell partial from final, wherever you read it. Sources that had not answered yet are simply **absent** from the data: not empty, not null — absent. The session is still open. Do not treat this as the outcome of the verification and do not close the case on it. The **complete** data arrives afterwards in [On Flow Ended](api:POST/es-public-administration:ended), whose payload carries `is_closed: true`. That is the only event that means the session is finished. </Warning> ## The payload It is the **same schema as the end event** — `FlowResultsSchema` — so you parse it with the same code you already wrote. The only difference is what is in it: the sources that finished, and nothing else. If an `aes_key` was provided during [Create Session](api:POST/es-public-administration/v1/manager/init), the partial results inside the `data` payload are delivered encrypted in `aes::Base64(IV + Ciphertext + Tag)` format. <Card title="Encrypted Payload" icon="fa-solid fa-key" href="/payload-encryption"> If you configured an `aes_key`, this payload is encrypted. View step-by-step decryption walkthrough and code templates in the **Payload Encryption** guide. </Card> If no `aes_key` was specified, the `data` payload is omitted (null), and you must retrieve the partial results manually using the session API. ## What it is for Use it to move early: show your user what you already have, or start the work that does not depend on the slow source. Then **wait for `es-public-administration:ended`** before treating the verification as complete. <Note title="Delivered at most once"> You receive this event **once per session**, even though the flow may move in and out of the waiting state several times while the remaining sources finish. As with every webhook, make your endpoint idempotent: a network-level retry must never create the record twice on your side. </Note>