National Superintendence of Customs and Tax Administration (SUNAT) - Peru
Lets integrate National Superintendence of Customs and Tax Administration (SUNAT) - Peru in your system. First, get your Apitude API key, then send a POST request to Apitude... And that's it!.
That POST request should return the following
{
"message": "Request processed successfully",
"url": "/api/v1.0/requests/sunat-pe/e0606c19-a32d-410f-b2eb-d57a665677bc/",
"request_id": "e0606c19-a32d-410f-b2eb-d57a665677bc"
}
This response will contains a unique request ID that you should poll using a GET as follows
How does the response looks like?
{
"result": {
"data": {
"found": true,
"nombre": "JHON WICK",
"padrones": "NINGUNO",
"numero_ruc": "10335222286",
"trabajadores": [
{
"periodo": "2023-03",
"numero_pensionistas": 12,
"numero_trabajadores": 34,
"numero_prestadores_de_servicio": 1
}
],
"deuda_coactiva": false,
"tipo_documento": "DNI",
"direccion_fiscal": "82 BEAVER ST, LIMA, LIMA, PERU",
"nombre_comercial": "TALLER EL EXCOMUNICADO",
"numero_documento": "33554328",
"otras_direciones": [
{
"fecha": "2014-03-01",
"direccion": "Edison Ballroom, 240 West 47th Street, New York, NY 10005, United States"
}
],
"tipo_contribuyente": "PERSONA NATURAL CON NEGOCIO",
"comprobantes_de_pago": "NINGUNO",
"sistema_contabilidad": "MANUAL",
"afiliado_al_ple_desde": "",
"fecha_de_inscripci\u00f3n": "2015-06-03",
"info_deudas_coactivas": [],
"omisiones_tributarias": [],
"actividades_economicas": [
{
"tipo": "PRINCIPAL",
"codigo": 4520,
"descripcion": "MANTENIMIENTO Y REPARACION DE VEHICULOS AUTOMOTORES"
}
],
"representantes_legales": [
{
"cargo": "GERENTE",
"nombre": "JHON WICK",
"fecha_desde": "2014-02-02",
"tipo_documento": "DNI",
"numero_documento": "88881111"
}
],
"emisor_electronico_desde": "",
"estado_del_contribuyente": "ACTIVO",
"comprobantes_electronicos": [],
"actividad_comercio_exterior": "SIN ACTIVIDAD",
"condicion_del_contribuyente": "HABIDO",
"fecha_de_inicio_de_actividades": "2015-06-01",
"sistema_de_emision_electronica": "",
"sistema_emision_de_comprobante": "MANUAL"
},
"error": "",
"end_at": "2023-03-23 21:54:06.453355",
"status": 200,
"message": "successful",
"queried_by": "YOUR-USER",
"service_name": "sunat-pe"
},
"message": "Request completed"
}
Ok, but what does each field in that JSON means?
The general parts:
message:
The message is an Apitude generatedstring
with an informational text about the request.result:
The result is contains the main part of the request.result.error:
The error is astring
generated by apitude for the request if everything worked it will be blank.result.message:
The message is astring
with two optionssuccessful
orunsuccessful
depending of how your request finished.result.queried_by:
The queried_by field is astring
that lets you know what user started the request.result.end_at:
The end_at field is astring formatted date
that lets you know at what time the request ended in Apitude.result.service_name:
The service_name field is astring
that echos the service called. For this service it will always besunat-pe
.result.status:
The status field is ainteger
that represents whether the service returned data from the input sent in the request. It could be one of the following values:200
: The service returned response data for the payload that was sent in the creation of the request.404
: The service did not returned data for the payload that was sent in the creation of the request.400
: The service did not started because your input was invalid.500
: Apitude tried to execute your request, however the service Apitude uses to execute your request was down. Please wait some time and try again, Apitude will not charged you for requests with this code.
Depending on the service, you want it to return different codes. For example, if you are checking the user against a security list to whitelist the user you should look for a
404
, because a200
would mean the user is in fact in the list. Other cases however, like creating objects in the name of a user you want the code to be200
, since it will imply the creation was a success.
The data in the response:
Please refer to the official docs of this service online to find out more about what data is returned.
About this service
The service allows the consultation through API of natural and legal persons in the National Superintendency of Customs and Tax Administration (SUNAT) of Peru using the DNI or RUC number. The service returns all the information that SUNAT has in its database, such as: names, addresses, debts, commercial activities, information on employees, legal representatives, billing, etc.
Who can you query using this service?:
This service (sunat-pe) is available for you to query individuals only.
Get API Access