Examples by country
🔠 Table of codes
The following are the codes to be used on peruvian operations. Use the navigation on your right to quickly move to different id.
All request to the API should be made using the first column ID. External codes are to be considered only for reference purposes.
country_id
| country_id | name |
|---|---|
| 83 | PERÚ |
| 1 | SENEGAL |
| 2 | GAMBIA |
| 3 | GUINEA-BISSAU |
| 4 | GUINEA |
| 5 | SIERRA LEONA |
| 6 | LIBERIA |
| 7 | COSTA DE MARFIL |
| 8 | GHANA |
| 9 | TOGO |
| 10 | NIGERIA |
| 11 | SUDAFRICA |
| 12 | BOTSWANA |
| 13 | LESOTHO |
| 14 | MALAWI |
| 15 | ZIMBABWE |
| 16 | ZAMBIA |
| 17 | COMORAS |
| 18 | MAURICIO |
| 19 | MADAGASCAR |
| 20 | MOZAMBIQUE |
| 21 | SWAZILANDIA |
| 22 | SUDAN |
| 23 | EGIPTO |
| 24 | LIBIA |
| 25 | TUNEZ |
| 26 | ARGELIA |
| 27 | MARRUECOS |
| 28 | CABO VERDE |
| 29 | CHAD |
| 30 | NIGER |
| 31 | ALTO VOLTA |
| 32 | MALI |
| 33 | MAURITANIA |
| 34 | TANZANIA |
| 35 | UGANDA |
| 36 | KENIA |
| 37 | SOMALIA |
| 38 | ETIOPIA |
| 39 | ANGOLA |
| 40 | BURUNDI |
| 41 | RWANDA |
| 42 | REP.DEM. CONGO |
| 43 | CONGO |
| 44 | GABON |
| 45 | S.TOM.PRINCIPE |
| 46 | GUINEA ECUATRL |
| 47 | REP.CENT.AFRIC. |
| 48 | CAMERUN |
| 49 | BENIN |
| 50 | TERR.BRIT.EN AF |
| 51 | TER.ESPAN.EN AF |
| 52 | TERR.FRAN.EN AF |
| 53 | BOPHUTHATSWANA |
| 54 | DJIBOUTI |
| 55 | SEYCHELLES |
| 56 | VIENDA |
| 57 | NAMIBIA |
| 58 | SUDAN DEL SUR |
| 59 | BURKINA FASO |
| 60 | CISKEY |
| 61 | ERITREA |
| 62 | ISLAS MARSHALL |
| 63 | SAHARAUI |
| 64 | TRANSKEI |
| 65 | VENEZUELA |
| 66 | COLOMBIA |
| 67 | TRINID.Y TOBAGO |
| 68 | BARBADOS |
| 69 | JAMAICA |
| 70 | REP.DOMINICANA |
| 71 | BAHAMAS |
| 72 | HAITI |
| 73 | CUBA |
| 74 | PANAMA |
| 75 | COSTA RICA |
| 76 | NICARAGUA |
| 77 | EL SALVADOR |
| 78 | HONDURAS |
| 79 | GUATEMALA |
| 80 | MEXICO |
| 81 | GUYANA |
| 82 | ECUADOR |
| 84 | BRASIL |
| 85 | BOLIVIA |
| 86 | PARAGUAY |
| 87 | URUGUAY |
| 88 | ARGENTINA |
| 89 | U.S.A. |
| 90 | CANADA |
| 91 | TERR.BRIT.EN AM |
| 92 | TERR.FRAN.EN AM |
| 93 | TER.HOLAN.EN AM |
| 94 | TERR.D/DINAMARC |
| 95 | DOMINICA |
| 96 | GRANADA |
| 97 | SANTA LUCIA(ISL |
| 98 | S.VTE.Y GRANAD. |
| 99 | SURINAM |
| 100 | BELICE |
| 101 | ANTIGUA Y BBUDA |
| 102 | SNT.KIT & NEVIS |
| 103 | ANGUILA |
| 104 | ARUBA |
| 105 | BERMUDAS |
| 106 | ISLAS VIRG.BRIT |
| 107 | ISLAS CAYMAN |
| 108 | ANTILLAS NEERLANDESA |
| 109 | TURCAS Y CAICOS |
| 110 | ISLAS VIRGENES (ESTADOS UNIDOS DE AMERICA) |
| 111 | MARTINICA |
| 112 | PUERTO RICO |
| 113 | MONSERRAT |
| 114 | GROENLANDIA |
| 115 | JORDANIA |
| 116 | ARABIA SAUDITA |
| 117 | KUWAIT |
| 118 | OMAN |
| 119 | CHIPRE |
| 120 | ISRAEL |
| 121 | IRAK |
| 122 | AFGANISTAN |
| 123 | IRAN |
| 124 | SIRIA |
| 125 | LIBANO |
| 126 | QATAR |
| 127 | BAHREIN |
| 128 | SRI LANKA |
| 129 | CAMBODIA |
| 130 | LAOS |
| 131 | INDIA |
| 132 | BHUTAN |
| 133 | THAILANDIA |
| 134 | NEPAL |
| 135 | BANGLADESH |
| 136 | YEMEN |
| 137 | YEMEN DEL SUR |
| 138 | PAKISTAN |
| 139 | VIETNAM |
| 140 | MYANMAR (EX BIRMANIA) |
| 141 | ISLAS MALDIVAS |
| 142 | INDONESIA |
| 143 | MALASIA |
| 144 | TAIWAN (FORMOSA) |
| 145 | JAPON |
| 146 | SINGAPUR |
| 147 | COREA DEL SUR |
| 148 | COREA DEL NORTE |
| 149 | FILIPINAS |
| 150 | CHINA |
| 151 | MONGOLIA |
| 152 | EMIR.ARAB.UNID. |
| 153 | HONG KONG |
| 154 | TER.PORTUG.E/AS |
| 155 | BRUNEI |
| 156 | MACAO |
| 157 | REPUBLICA DE YEMEN |
| 158 | FIJI |
| 159 | NAURU |
| 160 | ISLAS TONGA |
| 161 | SAMOA OCC. |
| 162 | NUEVA ZELANDIA |
| 163 | AUSTRALIA |
| 164 | TERR.BRIT.EN AU |
| 165 | TERR.FRAN.EN AU |
| 166 | T.NORTEAM.EN AU |
| 167 | PPUA.NVA.GUINEA |
| 168 | VANUATU |
| 169 | KIRIBATI |
| 170 | MICRONESIA |
| 171 | ISLAS SALOMON |
| 172 | TUVALU |
| 173 | PALAU |
| 174 | NIUE |
| 175 | POLINESIA FRANCESA |
| 176 | NUEVA CALEDONIA |
| 177 | ISLAS MARIANAS DEL NORTE |
| 178 | GUAM |
| 179 | TIMOR ORIENTAL |
| 180 | ISLAS COOK |
| 181 | PORTUGAL |
| 184 | ITALIA |
| 185 | FRANCIA |
| 186 | IRLANDA |
| 187 | DINAMARCA |
| 188 | SUIZA |
| 189 | AUSTRIA |
| 190 | REINO UNIDO |
| 191 | SUECIA |
| 192 | FINLANDIA |
| 193 | NORUEGA |
| 194 | BELGICA |
| 195 | HOLANDA |
| 196 | ISLANDIA |
| 197 | ESPAÑA |
| 198 | ALBANIA |
| 199 | RUMANIA |
| 200 | GRECIA |
| 202 | TURQUIA |
| 203 | MALTA |
| 204 | SANTA SEDE |
| 205 | ANDORRA |
| 207 | BULGARIA |
| 208 | POLONIA |
| 209 | CHECOESLOVAQUIA |
| 210 | HUNGRIA |
| 211 | LUXEMBURGO |
| 212 | LIECHTENSTEIN |
| 213 | MONACO |
| 214 | SAN MARINO |
| 215 | ARMENIA |
| 216 | AZERBAIJAN |
| 217 | BELARUS |
| 218 | BOSNIA HEZGVINA |
| 219 | REPUBLICA CHECA |
| 220 | REP.ESLOVACA |
| 221 | REPUBLICA DE SERBIA |
| 222 | CROACIA |
| 223 | ESLOVENIA |
| 224 | ESTONIA |
| 225 | GEORGIA |
| 226 | KAZAJISTÁN |
| 227 | KIRGISTÁN |
| 228 | LETONIA |
| 229 | LITUANIA |
| 230 | MACEDONIA |
| 231 | MOLDOVA |
| 232 | TAYIKISTÁN |
| 233 | TURKMENISTÁN |
| 234 | UCRANIA |
| 235 | UZBEKISTÁN |
| 236 | MONTENEGRO |
| 237 | RUSIA |
| 238 | ALEMANIA |
| 240 | GIBRALTAR |
| 241 | GUERNSEY |
| 242 | ISLA DE MAN |
| 243 | JERSEY |
| 244 | GILBRALTAR |
| 245 | COMB.Y LUBRIC. |
| 246 | RANCHO DE NAVES |
| 247 | PESCA EXTRA |
| 248 | ORIG.O DEST. NO |
| 249 | ZF.IQUIQUE |
| 250 | DEPOSITO FRANCO |
| 251 | ZF.PARENAS |
| 252 | ZF.ARICA-ZF IND |
| 253 | CHILE |
| 254 | NAC.REPUTADA |
| 255 | OTROS(PAIS DESCONOCIDO) |
currency_id
| currency_id | name | external_code |
|---|---|---|
| 7 | Sol | PEN |
| 5 | Dolar USA | USD |
| 38 | Euro | EUR |
tax_id_type
| tax_id_type | name | regular_expression | additional_validations |
|---|---|---|---|
| PE-RUC | Peruvian Taxpayer Identification Number (RUC) | ^\d{11}$ |
Format: 11 numeric digits. Structure: first digits indicate taxpayer type (10 = natural person, 20/17/15 = legal entity). Includes a check digit calculated using the Mod 11 algorithm. |
| PE-DNI | National Identity Document (DNI) | ^\d{8}$ |
8 numeric digits. No check digit. |
| PE-CE | Foreigner's Identification Card (CE) | ^[A-Za-z0-9]{9,12}$ |
Alphanumeric identifier issued to foreign residents. Length between 9 and 12 characters. No check digit. Letters and numbers allowed. |
| PE-PAS | Passport | ^[A-Za-z0-9]{6,12}$ |
Alphanumeric identifier issued by the passport holder's country. Length typically 6–12 characters. No algorithmic validation due to international variation. |
| PE-XXX | Non-domiciled / No Peruvian ID | ^.{1,20}$ |
Used when the receiver does not have a standard Peruvian ID (e.g., tourists). Any identifier up to 20 characters is accepted. No regulated validation rules. |
document_type_id
| document_type_id | Name | received_issued_flag | External Code |
|---|---|---|---|
| 96 | Factura emitida | 1 | 01 |
| 97 | Boleta de venta emitida | 1 | 03 |
| 98 | Nota de crédito para Factura emitida | 1 | 07 |
| 99 | Nota de débito emitida | 1 | 08 |
| 100 | Guia de remisión para remitente emitida | 1 | 09 |
| 101 | Guia de remisión para Transportista emitida | 1 | 31 |
| 102 | Factura recibida | 0 | 01 |
| 103 | Boleta de venta recibida | 0 | 03 |
| 104 | Nota de crédito recibida | 0 | 07 |
| 105 | Nota de débito recibida | 0 | 08 |
| 107 | Guia de remisión para remitente recibida | 0 | 09 |
| 108 | Guia de remisión para Transportista recibida | 0 | 31 |
| 109 | Comprobante de retención emitido | 1 | 20 |
| 110 | Comprobante de retención recibido | 1 | 20 |
| 155 | Nota de crédito para Boleta emitida | 1 | 07 |
The sender bill of lading series (100) usually starts with T. The carrier bill of lading series (101) must start with V.
tax_type_id
| tax_type_id | name | tax_type | value | external_code |
|---|---|---|---|---|
| 412 | IGV 16% | 2 | 16,0000 | 1000 |
| 413 | IGV 18% | 2 | 18,0000 | 1000 |
| 414 | IGV 0% | 2 | 0,0000 | 9997 |
| 415 | ISC Alcohol 20% | 2 | 20,0000 | 2000 |
| 416 | ISC Alcohol 50% | 2 | 50,0000 | 2000 |
| 417 | ISC Bebidas azucaradas 17% | 2 | 17,0000 | 2000 |
| 418 | ISC Cigarrillos | 3 | 0,0000 | 2000 |
| 419 | ISC Combustibles | 3 | 0,0000 | 2000 |
| 420 | ISC Vehículos 10% | 2 | 10,0000 | 2000 |
| 421 | ISC Vehículos 20% | 2 | 20,0000 | 2000 |
| 422 | ISC Vehículos Otros | 3 | 0,0000 | 2000 |
| 423 | ISC Bebidas azucaradas 25% | 2 | 25,0000 | 2000 |
| 424 | ISC Alcohol | 3 | 0,0000 | 2000 |
| 425 | Exportación | 2 | 0,0000 | 9995 |
| 426 | Operaciones gratuitas | 2 | 0,0000 | 9996 |
| 427 | Operaciones exoneradas | 2 | 0,0000 | 9997 |
| 428 | Operaciones inafectas | 2 | 0,0000 | 9998 |
| 429 | Otros conceptos de pago | 3 | 0,0000 | 9999 |
Notes: tax_type values: 1 = fixed value in money 2 = fixed percentage 3 = variable value in money to be defined by user as part of the request
tax_value: Positive numbers will add to the final amount, while negative values are retentions and will decrease the final amount
operation_type
Operation types are used on the additional >> pe_header field
| operation_type | Name | Description |
|---|---|---|
| 0101 | Internal sale | Sale of goods or services within the national territory. |
| 0112 | Internal sale – Supports deductible expenses of an individual | Internal sale that supports deductible expenses of an individual. |
| 0200 | Export of goods | Export operations of goods. |
| 0201 | Export of services – Services performed entirely in the country | Services performed entirely in Peru for a non-resident. |
| 0202 | Export of services – Lodging services for non-residents | Lodging services provided to non-residents. |
| 0203 | Export of services – Shipping company transport | Transport services provided by shipping companies. |
| 0204 | Export of services – Services to foreign-flagged ships and aircraft | Services provided to foreign-flagged ships and aircraft. |
| 0205 | Export of services – Services that are part of a tour package | Services that are part of a tour package. |
| 0206 | Export of services – Services complementary to cargo transport | Services complementary to international cargo transport. |
| 0207 | Export of services – Electricity supply to residents of a ZED | Electricity supply to residents of a Special Development Zone. |
| 0208 | Export of services – Services performed partly abroad | Services performed partly outside Peru. |
| 0301 | Operations with air waybill | Operations with an air waybill issued domestically. |
| 0302 | Passenger rail transport operations | Passenger rail transport services. |
| 0303 | Oil royalty payment operations | Oil royalty payments. |
| 0401 | Sales to non-residents that do not qualify as exports | Sales to non-residents that do not qualify as exports. |
| 1001 | Transaction subject to detraction | General detraction. Include the pe_detraction block with any catalog 54 code (example: code 022 at 12%). |
| 1002 | Detraction — Hydrobiological resources | Operation subject to detraction for hydrobiological resources. Include pe_detraction (code 004: 4% if the supplier meets the SUNAT conditions; otherwise 10%). |
| 1003 | Detraction — Passenger transport | Operation subject to detraction for passenger transport. Include pe_detraction (code 028; SUNAT sets a fixed amount per vehicle axle, not a percentage). |
| 1004 | Detraction — Cargo transport | Operation subject to detraction for cargo transport. Include pe_detraction (code 027, 4% of the higher of the operation amount and the reference value) and pe_cargo_transport. If pe_cargo_transport is missing, E-Fact returns 3116. |
| 2001 | Transaction subject to perception | Sales subject to the VAT perception system, where the buyer advances a portion of the tax. |
pe_detraction
Fields of the header >> additional >> pe_detraction block. It is required when pe_header.operation_type is 1001, 1002, 1003 or 1004; if it is missing, the API returns: When operation_type is 1001, 1002, 1003 or 1004, header.additional.pe_detraction is required.
| field | type | required | description |
|---|---|---|---|
| code | string | Yes | Catalog 54 code (see detraction_code). With 1002, 1003 and 1004 it must be 004, 028 and 027 respectively; otherwise the API returns pe_detraction.code must be XXX when operation_type is YYYY. |
| percent | number | Yes | Detraction percentage, greater than 0. |
| amount | number | Yes | Detraction amount, greater than 0 (usually percent applied to total_amount; for 1004, applied to the higher of the operation amount and the transport reference value). |
| nation_bank_account | string | Yes | Banco de la Nación detraction account. If missing, the API returns pe_detraction.nation_bank_account is required. |
| nation_bank_account_hide | boolean | No | Only accepts true: hides the account in the PDF (it is still sent in the XML). With any other value the API returns pe_detraction.nation_bank_account_hide only accepts true. |
| payment_means_code | string | No | Payment means (catalog 59). Defaults to 001. |
detraction_code
Detraction codes are used in additional >> pe_detraction >> code (SUNAT catalog 54). With 1002, 1003 and 1004 the code is fixed; 1001 accepts any catalog 54 code (the API only validates the code for 1002, 1003 and 1004). The amount field is typically the percent applied to total_amount.
Rates are set by SUNAT and may change; check the current rate at sunat.gob.pe.
| code | Name | percent | operation_type |
|---|---|---|---|
| 001 | Sugar and cane molasses | 10 | 1001 |
| 003 | Ethyl alcohol | 10 | 1001 |
| 004 | Hydrobiological resources | 4 or 10 | 1002 |
| 005 | Hard yellow corn | 4 | 1001 |
| 007 | Sugar cane | 10 | 1001 |
| 008 | Wood | 4 | 1001 |
| 009 | Sand and stone | 10 | 1001 |
| 010 | Waste, by-products, scraps and trimmings | 15 | 1001 |
| 012 | Labor intermediation and outsourcing | 12 | 1001 |
| 014 | Meat and edible offal | 4 | 1001 |
| 016 | Fish oil | 10 | 1001 |
| 017 | Flour, powder and pellets of fish, crustaceans, mollusks and other aquatic invertebrates | 4 | 1001 |
| 019 | Lease of movable property | 10 | 1001 |
| 020 | Maintenance and repair of movable property | 12 | 1001 |
| 021 | Cargo handling | 10 | 1001 |
| 022 | Other business services | 12 | 1001 |
| 023 | Milk | 4 | 1001 |
| 024 | Commercial commission | 10 | 1001 |
| 025 | Manufacturing of goods to order | 10 | 1001 |
| 026 | Passenger transport service | 10 | 1001 |
| 027 | Cargo transport service | 4 | 1004 |
| 028 | Passenger transport | Amount per axle | 1003 |
| 030 | Construction contracts | 4 | 1001 |
| 031 | Gold subject to IGV | 10 | 1001 |
| 032 | Paprika and other fruits of the genus capsicum or pimenta | 10 | 1001 |
| 034 | Non-gold metallic minerals | 10 | 1001 |
| 035 | IGV-exempt goods | 1.5 | 1001 |
| 036 | Gold and other IGV-exempt metallic minerals | 1.5 | 1001 |
| 037 | Other services subject to IGV | 12 | 1001 |
| 039 | Non-metallic minerals | 10 | 1001 |
| 041 | Lead | 15 | 1001 |
004: 4% only if the supplier holds the fishing permit for the vessel and appears on the SUNAT list of 4% suppliers; otherwise 10%.027: 4% of the higher of the operation amount and the transport reference value (D.S. N° 020-2021-MTC), unless there is no reference value or the cargo belongs to two or more users.028: SUNAT sets a fixed amount per vehicle axle at each toll (R.S. N° 057-2007/SUNAT), not a percentage. The API still requirespercentandamountgreater than 0.
For 1004, pe_cargo_transport is also required (origin and destination ubigeo and address, trip detail, and reference amounts). If it is omitted, E-Fact returns 3116.
payment_means_code (detraction)
Used in additional >> pe_detraction >> payment_means_code.
| payment_means_code | Name |
|---|---|
| 001 | Account deposit (Banco de la Nación) |
unit_measure
The details >> unit_measure field is sent as is to SUNAT as unitCode (UN/ECE rec 20, catalog 03); the API does not translate it. A code outside the catalog may be rejected by SUNAT. We recommend ZZ for services and NIU for goods.
| unit_measure | name |
|---|---|
| NIU | Unit (goods) |
| ZZ | Unit (services) |
| KGM | Kilogram |
| GRM | Gram |
| TNE | Tonne |
| LTR | Liter |
| MLT | Milliliter |
| GLL | Gallon |
| MTR | Meter |
| CMT | Centimeter |
| MTK | Square meter |
| CMK | Square centimeter |
| MTQ | Cubic meter |
| INH | Inch |
| BX | Box |
| PK | Package |
| PF | Pallet |
| PR | Pair |
| SET | Set |
| DZN | Dozen |
| BG | Bag |
| RM | Ream |
| ST | Sheet |
| BO | Bottle |
| CA | Can |
| HUR | Hour |
| DAY | Day |
| MON | Month |
| KWH | Kilowatt hour |
account certification_status
| certification_status | name | customer_action_required | explanation |
|---|---|---|---|
| 0 | Account created | Yes | The account was created, but no certificate has been uploaded |
| 21 | Tax situation | Yes | The SUNAT is not allowing the process to continue. Check status details and take action. |
| 22 | Inactive | Yes | There is a problem on the certification process that the customer hasn't resolved |
| 23 | Scheduled for elimination | Yes | This account is scheduled for elimination |
| 70 | Ready to be activated | No | The information was succesfully received and we are ready to activate invoices. |
| 71 | On hold: Declaration paused by client | Yes | The declaration process is paused due to a request or action by the client. |
| 72 | On hold: Declaration paused due to tax issue | Yes | The declaration process is paused due to a tax-related issue identified by the SUNAT. Check status details and take action. |
| 80 | Invoice certification | No | The account is certified to issue invoices. |
special_instructions
| code | field_name | explanation |
|---|---|---|
| 1 | SUNAT_Envio_IndicadorTrasladoTotalDAMoDS | Indicates that the transfer is covered by a Customs Declaration (DAM) or Simplified Declaration (DS). Required when the shipment reason is import/export and must include the corresponding customs document. |
| 2 | SUNAT_Envio_IndicadorTransbordoProgramado | Indicates that the goods are part of a scheduled transshipment. Used when cargo will be transferred from one transport unit to another as part of a planned logistics route. |
| 3 | SUNAT_Envio_IndicadorTrasladoVehiculoM1L | Indicates that the transport of the goods will be carried out using an M1 or L category vehicle (light vehicle or motorcycle). SUNAT requires this when the shipment is made using a small/light vehicle. |
| 4 | SUNAT_Envio_IndicadorRetornoVehiculoEnvaseVacio | Indicates the return of a vehicle carrying empty containers or packaging. Used when containers are delivered and the vehicle returns with empty units. |
| 5 | SUNAT_Envio_IndicadorRetornoVehiculoVacio | Indicates that the transport unit returns completely empty, without goods or containers. Used when only the vehicle returns. |
| 6 | SUNAT_Envio_IndicadorVehiculoConductoresTransp | Indicates that the transport includes multiple drivers or that the transport personnel are part of the shipment record. Used for special logistics operations that include more than one driver. |
handling_code
| reason_id | name | description |
|---|---|---|
| 01 | Sale | Indicates that the transfer is due to a sale. |
| 02 | Purchase | Indicates that the transfer is due to a purchase. |
| 13 | Other | Indicates that the transfer is due to other reasons not classified above. |
template_id
System PDF templates available for options.template_id. If template_id is not sent, the default template for the document type is used. The template must belong to the document's document_type_id.
| template_id | document_type_id | Name |
|---|---|---|
| 5000 | 96 | Factura emitida |
| 5004 | 96 | Factura hoja carta modelo 3 |
| 5001 | 97 | Boleta de venta |
| 5005 | 97 | Boleta hoja carta modelo 3 |
| 5006 | 98 | Nota de crédito Factura carta modelo 3 |
| 5008 | 99 | Nota de débito carta modelo 3 |
| 5002 | 100 | Guia de remisión para remitente emitida |
| 5009 | 100 | Guia de remisión remitente electrónica carta modelo 3 |
| 5010 | 101 | Guia de remisión transportista 80mm |
| 5011 | 101 | Guia de remisión transportista electrónica carta modelo 3 |
| 5007 | 155 | Nota de crédito Boleta carta modelo 3 |