SRI clave de acceso explained: the 49 digits, the módulo 11 check digit and common rejection causes (Ecuador)
By Zain Abbas, Kodenova · Updated
Every electronic comprobante in Ecuador carries a clave de acceso: a 49-digit number built by the issuer, not by the SRI. If it is wrong, the document is rejected or cannot be found when you query its authorization. This guide walks through each digit, the módulo 11 check digit, and the rejection causes we see most in SAP Business One projects.
You can build or check a key in our free SRI clave de acceso generator and validator while you read.
The 49 digits, field by field
The structure comes from the SRI Ficha técnica de comprobantes electrónicos, esquema offline (version 2.26, March 2024). The key goes in the <claveAcceso> tag of the XML.
| Position | Field | Length | Notes |
|---|---|---|---|
| 1–8 | Fecha de emisión | 8 | Format ddmmaaaa |
| 9–10 | Tipo de comprobante | 2 | See the table below |
| 11–23 | RUC del emisor | 13 | Issuer’s RUC |
| 24 | Tipo de ambiente | 1 | 1 = pruebas, 2 = producción |
| 25–30 | Serie | 6 | Establecimiento (3) + punto de emisión (3), for example 001001 |
| 31–39 | Secuencial | 9 | Left-padded with zeros |
| 40–47 | Código numérico | 8 | Chosen by the issuer |
| 48 | Tipo de emisión | 1 | 1 = emisión normal |
| 49 | Dígito verificador | 1 | Módulo 11 |
Tipo de comprobante codes
| Code | Document |
|---|---|
| 01 | Factura |
| 03 | Liquidación de compra de bienes y prestación de servicios |
| 04 | Nota de crédito |
| 05 | Nota de débito |
| 06 | Guía de remisión |
| 07 | Comprobante de retención |
A few details matter more than they look:
- Serie. The ficha shows the serie as one 6-digit field. The XML carries the establecimiento and punto de emisión as two separate 3-digit codes, so they must match the key.
- Secuencial. It must be 9 digits. A short secuencial produces a malformed key and a rejection.
- Código numérico. The SRI calls it a security mechanism and leaves the algorithm entirely to the issuer. Random or derived, it is your choice, but it must be 8 digits.
- Tipo de emisión. In the offline scheme only
1exists. Contingency keys were removed in version 2.0 of the ficha.
The módulo 11 check digit
The 49th digit is calculated over the first 48 digits with módulo 11 and weights 2 to 7.
- Take the 48 digits.
- Starting from the right, multiply each digit by 2, 3, 4, 5, 6, 7, then start again at 2.
- Add all the products.
- Divide the sum by 11 and keep the remainder.
- Subtract the remainder from 11.
- If the result is 11, the digit is 0. If it is 10, the digit is 1. Otherwise use the result.
Worked mini example
The SRI ficha uses the string 41261533:
| Digit | 4 | 1 | 2 | 6 | 1 | 5 | 3 | 3 |
|---|---|---|---|---|---|---|---|---|
| Weight | 3 | 2 | 7 | 6 | 5 | 4 | 3 | 2 |
| Product | 12 | 2 | 14 | 36 | 5 | 20 | 9 | 6 |
Sum = 104. 104 mod 11 = 5. 11 − 5 = 6. The check digit is 6.
A full key
Take an invoice (01) issued on 16 October 2026 in production (2), from establecimiento 001, punto de emisión 001, secuencial 123, código numérico 12345678, for the fictional RUC 1790012345001:
16102026 01 1790012345001 2 001001 000000123 12345678 1
The 48 digits weigh to a sum of 468. 468 mod 11 = 6, and 11 − 6 = 5. The complete clave de acceso is:
1610202601179001234500120010010000001231234567815
Paste it into the clave de acceso tool to see each field split out.
How the offline scheme uses the key
In the esquema offline, the issuer does most of the work:
- Generate the XML according to the SRI XSD for the document type.
- Generate the 49-digit clave de acceso.
- Sign the XML with XAdES-BES, using the .p12 certificate of your firma electrónica.
- Send it to the recepción web service. The answer is RECIBIDA or DEVUELTA.
- Wait, then query the autorización web service with the clave de acceso.
- Deliver the comprobante (XML and RIDE) to the buyer.
Two points come straight from the ficha. First, the clave de acceso becomes the número de autorización. Second, the SRI says it can take up to 24 hours to process a comprobante, so your system must handle a pending state instead of assuming an instant answer.
The test environment (celcer.sri.gob.ec) and production (cel.sri.gob.ec) have separate endpoints. The ambiente digit in the key must match the one you send to.
Common rejection causes
These are the SRI messages and situations we meet most often. Codes are from section 10 of the ficha técnica.
| Problem | SRI message | What usually caused it |
|---|---|---|
| Clave duplicada | 43 “Clave acceso registrada” | The same key sent twice, often after a timeout and a manual resend from a second document |
| Secuencial repeated | 45 “Secuencial registrado” | Two SAP B1 documents mapped to the same serie and secuencial |
| Key does not match the XML | 58 “Error en la estructura de clave acceso” | Date, RUC, serie or secuencial in the key differ from the XML |
| Key still processing | 70 “Clave de acceso en procesamiento” | A resend while the SRI is still working. Do not create a new key or secuencial; wait up to 24 hours |
| Firma electrónica | 39 “Firma inválida”, 40 “Error en el certificado”, 42 “Certificado revocado” | Wrong .p12, wrong password, or a certificate past its expiry date and not renewed |
| Late document | 65 “Fecha de emisión extemporánea” | Documents held in a queue and sent too late |
| Buyer ID | Warnings 59 “Identificación no existe”, 62 “Identificación incorrecta” | A cédula or RUC with a bad check digit, or the wrong tipo de identificación |
A few notes on the ones that cost the most time:
- Clave duplicada. Most duplicates come from retry logic, not the formula. After a timeout, query autorización with the same key first.
- Buyer RUC or cédula. Tipo de identificación codes are 04 RUC, 05 cédula, 06 pasaporte, 07 consumidor final (13 nines) and 08 identificación del exterior. Consumidor final is not allowed on liquidaciones de compra, and notas de crédito, notas de débito and retenciones always need a valid receptor. Check numbers before they reach SAP B1 with our Ecuador cédula and RUC validator.
- Secuencial gaps. The ficha asks issuers to emit in chronological and sequential order, without duplicate secuenciales or keys. Gaps usually appear when a document is cancelled in SAP B1 after the number was taken, or when two users post at the same time. They are hard to explain later, so keep the counter in one place.
- Expired firma electrónica. Certificates expire on a fixed date. Put that date in a calendar and renew before it, because every document fails until the new .p12 is loaded.
How SAP Business One generates the clave de acceso
SAP B1 has no field called clave de acceso out of the box in most setups. An integration builds it. In our SRI projects the pattern looks like this:
- Map numbering series to serie. Each SAP B1 document series is linked to one establecimiento and punto de emisión.
- Keep a separate secuencial. We do not rely on DocNum alone. A dedicated counter per serie and tipo de comprobante avoids collisions between users and companies.
- Build the key at posting time. The date comes from the document date, the RUC from company details, and the ambiente from a setting that differs between test and production databases.
- Store it on the document. The key, status and authorization date are saved in user-defined fields on the A/R invoice, credit memo, delivery or the A/P invoice that carries a retención, so users can see them without leaving SAP B1.
- Print it on the RIDE. The Crystal Reports layout shows the clave de acceso and its barcode.
- Handle pending and rejected states. A monitor screen lists documents in RECIBIDA, DEVUELTA or not authorized, with the SRI message, so someone fixes them the same day.
The formula is simple. The hard part is never reusing a secuencial and always resending with the original key. For the full integration scope, see our SRI Ecuador e-invoicing page.
Kodenova has delivered SRI integrations for SAP Business One. If your documents are being rejected or you are starting a new rollout, contact us with your SAP B1 version and the document types you issue.
Sources
- SRI: Ficha técnica comprobantes electrónicos esquema offline, versión 2.26 (March 2024)
- SRI: Facturación electrónica
Related services
Frequently asked questions
How many digits does the SRI clave de acceso have?
49. Forty-eight digits come from the document data (date, tipo de comprobante, RUC, ambiente, serie, secuencial, código numérico and tipo de emisión) and the last digit is the módulo 11 dígito verificador.
How is the dígito verificador calculated?
Multiply the first 48 digits from right to left by the weights 2, 3, 4, 5, 6, 7, repeating. Add the products, take the remainder of dividing by 11 and subtract it from 11. A result of 11 becomes 0 and a result of 10 becomes 1.
Is the clave de acceso the same as the número de autorización?
Yes, in the offline scheme. The SRI ficha técnica says the clave de acceso generated by the issuer becomes the authorization number of the comprobante.
Can I resend a rejected comprobante with a new clave de acceso?
If the SRI rejects a comprobante, the ficha técnica says to correct it and resend it with the same clave de acceso and secuencial. If you get error 70 (clave de acceso en procesamiento), do not resend or create a new key; wait for the answer, which can take up to 24 hours.
Is there a contingency key in the offline scheme?
No. Contingency keys were removed in version 2.0 of the offline ficha técnica, and only tipo de emisión 1 (emisión normal) exists.
Ready to get started?
Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.
