On Partial Results (Experience Closed)
On Partial Results (Experience Closed)
On Partial Results (Experience Closed)
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.
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, whose payload carries is_closed: true. That is the only event that means the session is finished.
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, the partial results inside the data payload are delivered encrypted in aes::Base64(IV + Ciphertext + Tag) format.
If no aes_key was specified, the data payload is omitted (null), and you must retrieve the partial results manually using the session API.
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.
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.
Payload class discriminator — always this value for Spain Public Administration events.
The event type: partial.
Base status codes for widget flows Allowed values are:
READY: The flow is waiting for an inputWAITING: Flow is waiting for an external eventCOMPLETED: The flow has finalized successfullyFAILED: The flow has failedSYSTEM_CANCELLED: The flow has ben cancelled by the systemCLIENT_CANCELLED: The flow has been cancelled by the clientCUSTOMER_CANCELLED: The flow has been cancelled by the customerTIMED_OUT: The flow has timed outCONFIGURATION_ERROR: The flow has been rejected due to a configuration errorPartial results: everything retrieved at the moment the user closed the experience.
ended event, FlowResultsSchema, with the sources
that had not answered yet simply absent. Parse it with the same code; do not expect every
field to be present.aes_key was provided when the
session was created, this payload is encrypted (see the Payload Decryption section of the
API introduction). If no aes_key was specified, this field is not informed (null) and
the partial results can be retrieved through the session API.ended. Treat this as an early view, not as a final answer, and
do not close the case on it.