> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# What is Lerian SCR?

> Lerian SCR is a REST facade over BACEN's wsscr2n SCR3 consultation channel. It returns a client's consolidated credit position and audits every query.

**Lerian SCR** is a REST facade over BACEN's **wsscr2n** web service, the SCR3 consultation channel. SCR is the *Sistema de Informações de Crédito*, the BACEN credit information system.

A consumer authenticates with a machine-to-machine token and asks Lerian SCR for a client's consolidated credit position. The service consults wsscr2n for the institution, decodes the result, audits the query, and returns it.

Each consultation writes an audit row. The audit write is fail-closed: a failed audit write fails the consultation, and the consumer gets no result.

A result cache, a per-institution concurrency limit, single-flight coalescing of identical queries, and a per-institution circuit breaker protect the channel.

## What Lerian SCR does and does not do

***

**Lerian SCR does:**

* **Call the wsscr2n channel.** It issues an HTTPS `GET` to BACEN's `/wsscr2n/cliente/resumo` operation with HTTP Basic authentication, over TLS 1.2 or later.
* **Decode the coded fields.** BACEN answers with codes. Lerian SCR resolves each code against the SCR annex tables and returns a `{ code, description }` pair.
* **Audit every query.** One consultation writes one audit row. Its personal data carries AES-256-GCM encryption at rest and an HMAC-SHA256 blind index for search.
* **Derive the institution from the token.** A request body, header, or path parameter never sets it.
* **Protect the tariffed channel.** A result cache, a two-connection cap per institution, single-flight coalescing, and a per-institution circuit breaker sit in front of BACEN.

**Lerian SCR does not:**

* **Use mTLS.** The channel authenticates the server only and puts HTTP Basic on top. Lerian SCR sends no client certificate.
* **Log the borrower document.** No log line, span, or error message carries it.
* **Hold the consent trail.** The request declares the holder's authorization under LC 105/2001. The consent record itself stays with the institution.
* **Create its database schema.** An operator applies the schema out of band before the service starts.

## Who it serves

***

Lerian SCR serves the internal consumers of a financial institution, such as a scoring consumer that needs a borrower's consolidated credit position. One deployment serves a single institution, or many institutions at once when multi-tenancy is on.

## Glossary

***

| Term                          | Meaning                                                                                                                                                                      |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SCR**                       | *Sistema de Informações de Crédito*, the BACEN credit information system.                                                                                                    |
| **SCR3**                      | The SCR consultation contract that the wsscr2n web service serves.                                                                                                           |
| **wsscr2n**                   | BACEN's web service for the SCR3 consultation. Lerian SCR is the facade over it.                                                                                             |
| **WSCR0001**                  | The Sisbacen transaction that grants an institution access to the consultation web service. The channel credential is the institution's virtual service user, not this name. |
| **IF**                        | *Instituição financeira*, the financial institution. One tenant of Lerian SCR.                                                                                               |
| **Reference date (`AAAAMM`)** | One SCR month, as a six-digit year-and-month integer. BACEN also calls it the *data-base*.                                                                                   |
| **Position**                  | A borrower's consolidated credit picture for one reference date. An empty result means no position, not an error.                                                            |
| **Tariff**                    | The BACEN charge for a consultation, per client and per reference date. A cache hit carries no tariff.                                                                       |
| **Blind index**               | The deterministic HMAC of a borrower document. It makes a row searchable and keeps the document out of the clear.                                                            |
| **Single-flight**             | The coalescing of identical concurrent consultations into one call to BACEN.                                                                                                 |
| **Circuit breaker**           | The per-institution guard that stops calls to BACEN after repeated channel failures.                                                                                         |

For how Lerian SCR sits alongside the other native rails and the partner interfaces, see [Native messaging and partner interfaces](/en/rails/native/native-messaging).
