Interfaces
How does an asynchronous verification request remain comprehensible for the caller?
The following endpoints are a separate API proposal. They show the domain contracts; specific provider fields are mapped in an adapter to the selected provider protocol, while the callback API authenticates the input. In the example, the incoming event receives the ID E-17 and is only confirmed with 2xx after permanent acceptance.
Starting point I-17 runs longer than a single request and can receive a late or repeated provider result.
Assumptions for the example case
Example design: an operator, a verification provider and a specified purpose of use. Identity and other evidence shall be assessed separately. Login, sessions, and rights across multiple applications are not part of this case. Figures and target values are design assumptions; no real people are checked.
Track request I-17 through to a readable decision
I-17 · Contract with roles, time and separate confirmations
Domain application → Verification API
- CommandPOST /verification-requests with purpose and idempotency key
- TimestampImmediately: Order I-17 and Outbox entry are saved
- Response202 Accepted · status pending · no domain approval
- Caller and verification service
- Our API and durable acceptance
- Domain state available to read later
202 acknowledges command acceptance. 2xx acknowledges durable callback receipt. The domain decision follows later.
The key contracts
- POST
/verification-requestsCreate a verification request
- Input
- Logged in person from the server context, permitted purpose and idempotency key.
- Result
- 202 with requestId and status; offer capture only after successful provider session.
- Retry behaviour
- The same key and the same parameters deliver the same order. Deviating parameters are rejected.
- GET
/verification-requests/{id}Show verification status
- Input
- Eligible caller and their own order ID.
- Result
- Status, next action and, if applicable, own decision reference; no raw provider personal data.
- Retry behaviour
- Read-only and repeatable; limit polling by increasing the interval.
- POST
/provider-eventsAcceptance of the provider’s results
- Input
- Original authenticated request with session/attempt reference.
- Result
- 2xx only after permanent acceptance or recognized duplicate; processing subsequently takes place.
- Retry behaviour
- Adapter forms a stable event key from the actually available provider fields.
- GET
/eligibility-decisions/{id}Check eligibility
- Input
- Authorized domain application; person and purpose must fit the decision.
- Result
- Result, reasonCode, ruleVersion, validUntil and revocation status.
- Retry behaviour
- Every use checks the current status; an old browser copy is not enough.
Keep an uncertain outcome visible
- Time-out at the provider
- A timeout during session creation can occur even when creation succeeds. Reconcile using a stable request reference; start a new attempt only after failure has been established.
- Two different confirmations
- The HTTP response to the webhook acknowledges receipt by our system. The domain decision follows validation, assignment and rule evaluation.
Terms in this step
- Idempotency
- A repetition of the same assignment does not produce any additional business effect.
Try it yourself
Sketch Command, immediate response, provider event, and later status query. Identify the stable request key.
A hint for your attempt
Transport confirmation and domain success require different statuses. A repetition shall not generate a second verification request.
Compare with a possible solution
- Acceptance
- POST generates or finds I-17 for P-17 and Z-3 and delivers `pending` with stable requestKey. Test: the same key with the same parameters is sent twice; exactly one order is created. A different purpose is a negative case and is rejected.
- Completion
- The authenticated callback API persists E-17 in the inbox and only then confirms with 2xx. The worker later processes E-17 atomically with D-17 and the order status; GET delivers decision result (`erfüllt` or `nicht erfüllt`), justification and validity. A lost worker run is repeated without creating a second effect.
Apply to your project
Which key makes a repeated order unique in your system?