Validation flows — what are they?
In Veriko, we define a "validation flow" as the process that takes the data of a SPEI transfer (as text or image) and searches whether Banxico issued a CEP or a transaction record with that data.
A validation always ends in a "terminal state" (see below).
Manual validation vs image-based (OCR)
- Manual (
POST /v1/validate): You must send the following data in plain text:clave_rastreo— Optional ifreferenciais sent.cuenta_beneficiariamontofechaemisorreceptor— Optional ifcuenta_beneficiariais CLABE/Card.
Full guide at: Validate a SPEI transfer (manual)
- Image-based (OCR) (
POST /v1/validate-ocr): You must send an image (Base64) or a URL (https):image— Optional ifimage_urlis sent.image_url— Optional ifimageis sent.cuenta_beneficiaria,banco_emisor,banco_receptor— Optional. Only if they are not present in the image.
Full guide at: Validate a SPEI transfer from an image (OCR)
Sync vs async
By default both endpoints are synchronous: that is, the system holds the request until Banxico responds (the median is 3-5s; the recommended timeout is 30s).
If you need to close the connection sooner or set a shorter timeout, simply add ?async=1 to the URL as a GET parameter. Then:
- The endpoint instantly returns
202with avalidation_id, plus anETagand aRetry-Afterheader. - The system enqueues and begins processing the validation.
- You can poll
GET /v1/validations/{id}periodically to retrieve the validation's status (preferably sendingIf-None-Matchwith the last ETag seen). As long as the row does not transition, the server responds304 Not Modified; when thestatuschanges the ETag changes and the poll's body carries the final result.
Full detail at: Async validations.
Terminal states
Each row can resolve to one of these 6 values:
valid— CEP found. It is the only verdict that obtains the CEP and counts as "verified" for your finance (see CEP and Finance).not_found— No CEP or transaction found with that data.cep_unavailable— The transaction was found but not the CEP (typically not yet settled or there are delays in the banking system).invalid— Banxico answered the request in an unexpected way (malformed data).failed— Application-level exception (error).error— Transport-level exception (error) (typically 5xx).
Retries
A terminal row may enter a retry cycle when its outcome (terminal state) is one of these:
not_foundcep_unavailableerror
The policy is set at the account level with PUT /v1/validations/{id}/retry-policy and defines enabled, max_retries, interval_seconds, and the specific outcomes from the list.
Full detail at: Retry policy.
Idempotency-Key
The Idempotency-Key header is optional. It is handled as follows:
- New key → The request is processed normally, and the response is persisted for replays.
- Same body with a repeated key → The endpoint responds
200with the cached response. - Different body with a repeated key → The endpoint responds
422 idempotency_key_reused. - Same key still processing → The endpoint responds
409 idempotency_key_in_progress.
Full detail at: Idempotency.