Ir al contenido
ReferenciaErrores
Sello del hash RcWDB37quLwxzMdY2HCGC9lnCZQ=rc-exempt-and-unaffected · DIGESTVALUE · RcWDB37quLwxzMdY2HCGC9lnCZQ= ·

Ejemplos / Resumen diario (RC) / Caso 16 de 21

Resumen diario con exoneradas e inafectas

Tres boletas: una gravada, exonerada e inafecta a la vez, otra solo exonerada y otra solo inafecta; las dos últimas llevan el IGV en cero.

Firma este JSON con el certificado de prueba y tu DigestValue tiene que ser RcWDB37quLwxzMdY2HCGC9lnCZQ=. El sello es ese valor, dibujado.

Los tres archivos, en el repositorio: el JSON de entrada, el XML sin firmar y el XML firmado.

A diferencia de la factura, no vuelve con la CDR: sunat-sdk summary devuelve un ticket, y con sunat-sdk ticket preguntas hasta que la traiga; con 98 se pregunta otra vez, no se reenvía. Desde PHP, con summary() y ticket() (Paso a producción).

Entrada en JSON

Marcadas, las líneas que cambian respecto del caso más parecido, Resumen diario de dos boletas; lo igual queda plegado.

fixtures/rc-exempt-and-unaffected.json
{  "kind": "summary",  "number": "4",
MostrarOcultar las líneas 4 a 24
  "generation_date": "2026-10-15",  "reference_date": "2026-10-14",  "currency": "PEN",  "issuer": {    "ruc": "20123456789",    "legal_name": "EMPRESA DEMO ORACULO S.A.C.",    "trade_name": "DEMO ORACULO",    "email": "facturacion@example.com",    "telephone": "014000000",    "address": {      "ubigeo": "150101",      "country_code": "PE",      "department": "LIMA",      "province": "LIMA",      "district": "LIMA",      "urbanization": "-",      "street": "AV. EJEMPLO 123",      "establishment_code": "0000"    }  },  "lines": [
    {      "document_type": "03",      "document_number": "B001-4",      "status": "1",      "customer_document_type": "1",      "customer_document_number": "12345678",      "total": "160.00",      "taxed": "50.00",      "exempt": "41.00",      "unaffected": "60.00",      "igv": "9.00"    },    {      "document_type": "03",      "document_number": "B001-5",      "status": "1",      "customer_document_type": "1",      "customer_document_number": "87654321",      "total": "25.00",      "exempt": "25.00",      "igv": "0.00"    },    {      "document_type": "03",      "document_number": "B001-6",      "status": "1",      "customer_document_type": "1",      "customer_document_number": "11223344",      "total": "12.50",      "unaffected": "12.50",      "igv": "0.00"    }  ]}

XML sin firmar

Marcadas, las líneas que cambian respecto de Resumen diario de dos boletas.

tests/vectors/rc-exempt-and-unaffected.unsigned.xml
<?xml version="1.0" encoding="utf-8"?><SummaryDocuments xmlns="urn:sunat:names:specification:ubl:peru:schema:xsd:SummaryDocuments-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1">  <ext:UBLExtensions>    <ext:UBLExtension>      <ext:ExtensionContent/>    </ext:UBLExtension>  </ext:UBLExtensions>  <cbc:UBLVersionID>2.0</cbc:UBLVersionID>  <cbc:CustomizationID>1.1</cbc:CustomizationID>  <cbc:ID>RC-20261015-4</cbc:ID>
MostrarOcultar las líneas 11 a 40
  <cbc:ReferenceDate>2026-10-14</cbc:ReferenceDate>  <cbc:IssueDate>2026-10-15</cbc:IssueDate>  <cac:Signature>    <cbc:ID>IDSignKG</cbc:ID>    <cac:SignatoryParty>      <cac:PartyIdentification>        <cbc:ID>20123456789</cbc:ID>      </cac:PartyIdentification>      <cac:PartyName>        <cbc:Name><![CDATA[EMPRESA DEMO ORACULO S.A.C.]]></cbc:Name>      </cac:PartyName>    </cac:SignatoryParty>    <cac:DigitalSignatureAttachment>      <cac:ExternalReference>        <cbc:URI>#signatureKG</cbc:URI>      </cac:ExternalReference>    </cac:DigitalSignatureAttachment>  </cac:Signature>  <cac:AccountingSupplierParty>    <cbc:CustomerAssignedAccountID>20123456789</cbc:CustomerAssignedAccountID>    <cbc:AdditionalAccountID>6</cbc:AdditionalAccountID>    <cac:Party>      <cac:PartyLegalEntity>        <cbc:RegistrationName><![CDATA[EMPRESA DEMO ORACULO S.A.C.]]></cbc:RegistrationName>      </cac:PartyLegalEntity>    </cac:Party>  </cac:AccountingSupplierParty>  <sac:SummaryDocumentsLine>    <cbc:LineID>1</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>
    <cbc:ID>B001-4</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>12345678</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">160.00</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">50.00</cbc:PaidAmount>      <cbc:InstructionID>01</cbc:InstructionID>    </sac:BillingPayment>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">41.00</cbc:PaidAmount>      <cbc:InstructionID>02</cbc:InstructionID>    </sac:BillingPayment>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">60.00</cbc:PaidAmount>      <cbc:InstructionID>03</cbc:InstructionID>    </sac:BillingPayment>
MostrarOcultar las líneas 62 a 75
    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">9.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">9.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine>
  <sac:SummaryDocumentsLine>    <cbc:LineID>2</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>    <cbc:ID>B001-5</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>87654321</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">25.00</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">25.00</cbc:PaidAmount>      <cbc:InstructionID>02</cbc:InstructionID>    </sac:BillingPayment>    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine>
MostrarOcultar las líneas 106 a 136
  <sac:SummaryDocumentsLine>    <cbc:LineID>3</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>    <cbc:ID>B001-6</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>11223344</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">12.50</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">12.50</cbc:PaidAmount>      <cbc:InstructionID>03</cbc:InstructionID>    </sac:BillingPayment>    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine></SummaryDocuments>

Formateado para leerlo. «Copiar» copia el archivo tal como está en el repositorio, en una línea.

Firma

Firmado con el certificado de prueba del SDK, el que baja la guía de inicio.

Sello del hash RcWDB37quLwxzMdY2HCGC9lnCZQ=

RcWDB37quLwxzMdY2HCGC9lnCZQ=

Si tu DigestValue es este, tu XML es el mismo que el del SDK. Con el certificado de prueba el SignatureValue también coincide; con el tuyo cambia, porque depende de tu clave.

DigestValue
RcWDB37quLwxzMdY2HCGC9lnCZQ=
SignatureValue
5tUloM8MRF57pZrXFkbrIl/x33EormolSLzgNFOsrOcSKjrueraMcFU0mNtqGykDIdpJv9eczRzWvQH0dzpjpL6Y80pfMq+gZrM2gkaTyuwSudrSEw88kacvRcHCvrLVsBYSRF9sGiBR4Bth0MwjoRAtQkBmgg0t9ct/oeG5yq8yJYunoGgarucvnWCI9LJ1H3Lc9FbQHE9xwy/IdjBPrPn/I5+dHPjIAk6lgXVJJ8SSRYShg1PWDiyo8OAmvk1utt644761nGi0yrDWawwXnPlVpCuzvkxeFLDkytSdv4v4hEKkeLx1UM0n/mSU+plLSGW/htUXuYykqg53iFTMog==

XML firmado

tests/vectors/rc-exempt-and-unaffected.signed.xml
<?xml version="1.0" encoding="utf-8"?><SummaryDocuments xmlns="urn:sunat:names:specification:ubl:peru:schema:xsd:SummaryDocuments-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1">  <ext:UBLExtensions>    <ext:UBLExtension>      <ext:ExtensionContent>        <ds:Signature Id="signatureKG">          <ds:SignedInfo>            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>            <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>            <ds:Reference URI="">              <ds:Transforms>                <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>              </ds:Transforms>              <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>              <ds:DigestValue>RcWDB37quLwxzMdY2HCGC9lnCZQ=</ds:DigestValue>            </ds:Reference>          </ds:SignedInfo>          <ds:SignatureValue>5tUloM8MRF57pZrXFkbrIl/x33EormolSLzgNFOsrOcSKjrueraMcFU0mNtqGykDIdpJv9eczRzWvQH0dzpjpL6Y80pfMq+gZrM2gkaTyuwSudrSEw88kacvRcHCvrLVsBYSRF9sGiBR4Bth0MwjoRAtQkBmgg0t9ct/oeG5yq8yJYunoGgarucvnWCI9LJ1H3Lc9FbQHE9xwy/IdjBPrPn/I5+dHPjIAk6lgXVJJ8SSRYShg1PWDiyo8OAmvk1utt644761nGi0yrDWawwXnPlVpCuzvkxeFLDkytSdv4v4hEKkeLx1UM0n/mSU+plLSGW/htUXuYykqg53iFTMog==</ds:SignatureValue>          <ds:KeyInfo>            <ds:X509Data>              <ds:X509Certificate>MIID8zCCAtugAwIBAgIUY968iRS4gHDjt9RwTaDaujmFLO0wDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlBFMS8wLQYDVQQKDCZURVNUIE9OTFkgLSBOT1QgVkFMSUQgRk9SIEFOWSBUQVhQQVlFUjESMBAGA1UECwwJVEVTVCBPTkxZMRQwEgYDVQQFEwsyMDAwMDAwMDAwMTEeMBwGA1UEAwwVVEVTVCBPTkxZIDIwMDAwMDAwMDAxMB4XDTI2MTAxNTIxMjc0NVoXDTM2MTAxMjIxMjc0NVowgYgxCzAJBgNVBAYTAlBFMS8wLQYDVQQKDCZURVNUIE9OTFkgLSBOT1QgVkFMSUQgRk9SIEFOWSBUQVhQQVlFUjESMBAGA1UECwwJVEVTVCBPTkxZMRQwEgYDVQQFEwsyMDAwMDAwMDAwMTEeMBwGA1UEAwwVVEVTVCBPTkxZIDIwMDAwMDAwMDAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6GZTtpFyih4C6ETakE6Q4+SFBFWJ/TQi2pbxJRD7GkQ1tKeB+ENcBk8EjnOocxdYWvSBpOd9UYkpc2C+jlbVWd04ey8psznwCHzJJ1+qgQqVI8PpH5A4eEw5LGXupHmnJSYpGXFGIJ6+tlJRqvZbq7RTh7Rpxs4DkCjUhUke/BKIZahYDzSGFLlsWx01Dq8Xeb6xF2sLlZXy/b0MvRZAe7I/xplIftS/rrDQ/rE5DfS0Dibayc/uNIRw1+NiKpT0wwY/VCzRQrM27dG7sTyhNAy6C3vtRmO5Bl9+0wrXldZcR4VSm1yrg65KRWv6DNcG2MkxRYBphaM+sJfkNECs6wIDAQABo1MwUTAdBgNVHQ4EFgQUE359gu7BEXWLRhx+VNBeec2Pp/kwHwYDVR0jBBgwFoAUE359gu7BEXWLRhx+VNBeec2Pp/kwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAzjWgukifoL9gZckM2jWW7a+N6+5W/0EkGJVFV9RbCceNpDpdMyVD4QyVm1nOJ/bQzOLdDnjyD3J34/1pEwo/hS/HehPy50twvf/uKEwPU4TNQTyjChnM3k+IX7cOusuPIBsC6trufeHOSky5lWiKWusMHo8VsPvVinE0n/RqTo47enHPFa6huF3egiQEJ6H+lxerXvWT8IkaGFA2YKjAGGsenlCSw9rRGX4tzQtUkJx0oFaEZGNpq+OYr334J3cZp9LskUFnrvRoAz3Fk8HdbVlfQTovFunFY9VzxbKjBfyWa6hymTxcvBR9x4ZfUKM9P3REeBKaTWdqe2oz4d6LLA==</ds:X509Certificate>            </ds:X509Data>          </ds:KeyInfo>        </ds:Signature>      </ext:ExtensionContent>    </ext:UBLExtension>  </ext:UBLExtensions>  <cbc:UBLVersionID>2.0</cbc:UBLVersionID>  <cbc:CustomizationID>1.1</cbc:CustomizationID>  <cbc:ID>RC-20261015-4</cbc:ID>  <cbc:ReferenceDate>2026-10-14</cbc:ReferenceDate>  <cbc:IssueDate>2026-10-15</cbc:IssueDate>  <cac:Signature>    <cbc:ID>IDSignKG</cbc:ID>    <cac:SignatoryParty>      <cac:PartyIdentification>        <cbc:ID>20123456789</cbc:ID>      </cac:PartyIdentification>      <cac:PartyName>        <cbc:Name><![CDATA[EMPRESA DEMO ORACULO S.A.C.]]></cbc:Name>
Mostrar las 116 líneas restantes (156 en total)
      </cac:PartyName>    </cac:SignatoryParty>    <cac:DigitalSignatureAttachment>      <cac:ExternalReference>        <cbc:URI>#signatureKG</cbc:URI>      </cac:ExternalReference>    </cac:DigitalSignatureAttachment>  </cac:Signature>  <cac:AccountingSupplierParty>    <cbc:CustomerAssignedAccountID>20123456789</cbc:CustomerAssignedAccountID>    <cbc:AdditionalAccountID>6</cbc:AdditionalAccountID>    <cac:Party>      <cac:PartyLegalEntity>        <cbc:RegistrationName><![CDATA[EMPRESA DEMO ORACULO S.A.C.]]></cbc:RegistrationName>      </cac:PartyLegalEntity>    </cac:Party>  </cac:AccountingSupplierParty>  <sac:SummaryDocumentsLine>    <cbc:LineID>1</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>    <cbc:ID>B001-4</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>12345678</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">160.00</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">50.00</cbc:PaidAmount>      <cbc:InstructionID>01</cbc:InstructionID>    </sac:BillingPayment>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">41.00</cbc:PaidAmount>      <cbc:InstructionID>02</cbc:InstructionID>    </sac:BillingPayment>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">60.00</cbc:PaidAmount>      <cbc:InstructionID>03</cbc:InstructionID>    </sac:BillingPayment>    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">9.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">9.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine>  <sac:SummaryDocumentsLine>    <cbc:LineID>2</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>    <cbc:ID>B001-5</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>87654321</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">25.00</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">25.00</cbc:PaidAmount>      <cbc:InstructionID>02</cbc:InstructionID>    </sac:BillingPayment>    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine>  <sac:SummaryDocumentsLine>    <cbc:LineID>3</cbc:LineID>    <cbc:DocumentTypeCode>03</cbc:DocumentTypeCode>    <cbc:ID>B001-6</cbc:ID>    <cac:AccountingCustomerParty>      <cbc:CustomerAssignedAccountID>11223344</cbc:CustomerAssignedAccountID>      <cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>    </cac:AccountingCustomerParty>    <cac:Status>      <cbc:ConditionCode>1</cbc:ConditionCode>    </cac:Status>    <sac:TotalAmount currencyID="PEN">12.50</sac:TotalAmount>    <sac:BillingPayment>      <cbc:PaidAmount currencyID="PEN">12.50</cbc:PaidAmount>      <cbc:InstructionID>03</cbc:InstructionID>    </sac:BillingPayment>    <cac:TaxTotal>      <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>      <cac:TaxSubtotal>        <cbc:TaxAmount currencyID="PEN">0.00</cbc:TaxAmount>        <cac:TaxCategory>          <cac:TaxScheme>            <cbc:ID>1000</cbc:ID>            <cbc:Name>IGV</cbc:Name>            <cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>          </cac:TaxScheme>        </cac:TaxCategory>      </cac:TaxSubtotal>    </cac:TaxTotal>  </sac:SummaryDocumentsLine></SummaryDocuments>

Formateado para leerlo. «Copiar» copia el archivo tal como está en el repositorio.

Reproducirlo

Con el SDK instalado como dice la guía de inicio, baja el caso y el certificado de prueba:

Terminal
curl -fsSL --remote-name-all \  https://fe.kembec.com/sdk/v0.1.0-beta.5/rc-exempt-and-unaffected.json \  https://fe.kembec.com/sdk/v0.1.0-beta.5/test-cert.pem \  https://fe.kembec.com/sdk/v0.1.0-beta.5/test-key.pem

Fírmalo como en la guía: tu DigestValue tiene que ser el de arriba.

PHP

En firmar.php, la línea del JSON queda así:

firmar.php
$factura = file_get_contents(__DIR__ . '/rc-exempt-and-unaffected.json');
Terminal
php firmar.php

JavaScript

En firmar.mjs, la línea del JSON queda así:

firmar.mjs
const built = JSON.parse(sdk.build(leer('rc-exempt-and-unaffected.json')));
Terminal
node firmar.mjs

Python

En firmar.py, la línea del JSON queda así:

firmar.py
built = sunat_sdk.build(leer('rc-exempt-and-unaffected.json'))
Terminal
python firmar.py

CLI

Terminal
sunat-sdk build < rc-exempt-and-unaffected.json \  | sunat-sdk sign --cert test-cert.pem --key test-key.pem > firmada.jsongrep -o '"digest_value":"[^"]*"' firmada.jsongrep -q '"digest_value":"RcWDB37quLwxzMdY2HCGC9lnCZQ="' firmada.json && echo "digest ok"