SRI clave de acceso explained: the 49 digits, the módulo 11 check digit and common rejection causes (Ecuador)

By Zain Abbas, Kodenova · Updated

Short answerThe SRI clave de acceso is a 49-digit number that identifies every electronic comprobante in Ecuador. It joins the issue date, document type, issuer RUC, environment, serie, secuencial, an 8-digit código numérico and the tipo de emisión, then adds a módulo 11 check digit. In the offline scheme it also becomes the authorization number, so one wrong digit means the document cannot be authorized.

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.

PositionFieldLengthNotes
1–8Fecha de emisión8Format ddmmaaaa
9–10Tipo de comprobante2See the table below
11–23RUC del emisor13Issuer’s RUC
24Tipo de ambiente11 = pruebas, 2 = producción
25–30Serie6Establecimiento (3) + punto de emisión (3), for example 001001
31–39Secuencial9Left-padded with zeros
40–47Código numérico8Chosen by the issuer
48Tipo de emisión11 = emisión normal
49Dígito verificador1Módulo 11

Tipo de comprobante codes

CodeDocument
01Factura
03Liquidación de compra de bienes y prestación de servicios
04Nota de crédito
05Nota de débito
06Guía de remisión
07Comprobante 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 1 exists. 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.

  1. Take the 48 digits.
  2. Starting from the right, multiply each digit by 2, 3, 4, 5, 6, 7, then start again at 2.
  3. Add all the products.
  4. Divide the sum by 11 and keep the remainder.
  5. Subtract the remainder from 11.
  6. 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:

Digit41261533
Weight32765432
Product122143652096

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:

  1. Generate the XML according to the SRI XSD for the document type.
  2. Generate the 49-digit clave de acceso.
  3. Sign the XML with XAdES-BES, using the .p12 certificate of your firma electrónica.
  4. Send it to the recepción web service. The answer is RECIBIDA or DEVUELTA.
  5. Wait, then query the autorización web service with the clave de acceso.
  6. 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.

ProblemSRI messageWhat usually caused it
Clave duplicada43 “Clave acceso registrada”The same key sent twice, often after a timeout and a manual resend from a second document
Secuencial repeated45 “Secuencial registrado”Two SAP B1 documents mapped to the same serie and secuencial
Key does not match the XML58 “Error en la estructura de clave acceso”Date, RUC, serie or secuencial in the key differ from the XML
Key still processing70 “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ónica39 “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 document65 “Fecha de emisión extemporánea”Documents held in a queue and sent too late
Buyer IDWarnings 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:

  1. Map numbering series to serie. Each SAP B1 document series is linked to one establecimiento and punto de emisión.
  2. 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.
  3. 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.
  4. 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.
  5. Print it on the RIDE. The Crystal Reports layout shows the clave de acceso and its barcode.
  6. 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

Related services

FAQ

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.