Ver empresa
Detalle de una empresa de la cuenta autenticada.
Autenticación: token Bearer de cuenta (empresas:manage).
Consideraciones
- Los tres modos operativos vienen en el objeto:
envio(quién manda a SUNAT),boletas(sueltas o por resumen) yrespuesta(si el envío compat espera el CDR).
Headers
| Name | Type | Description |
|---|---|---|
| Accept | string | application/json |
| Content-Type | string | application/json |
| Authorization | string | Bearer <token>. Genéralo desde tu panel, en Tokens de API. |
Parámetros de URL
| Name | Type | Description |
|---|---|---|
| ruc* | string | RUC de 11 dígitos de la empresa. |
Ejemplo de solicitud
Copiar
curl -X GET https://api.xmlperu.dev/v1/companies/20123456789 \
-H "Authorization: Bearer $TOKEN_CUENTA" \
-H "Accept: application/json"Copiar
<?php
$token_cuenta = 'pega-aqui-tu-token';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.xmlperu.dev/v1/companies/20123456789');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token_cuenta,
'Accept: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);Copiar
const TOKEN_CUENTA = 'pega-aqui-tu-token';
const res = await fetch('https://api.xmlperu.dev/v1/companies/20123456789', {
method: 'GET',
headers: {
Authorization: `Bearer ${TOKEN_CUENTA}`,
Accept: 'application/json',
},
});
const data = await res.json();Copiar
import requests
TOKEN_CUENTA = "pega-aqui-tu-token"
headers = {
"Authorization": f"Bearer {TOKEN_CUENTA}",
"Accept": "application/json",
}
res = requests.get("https://api.xmlperu.dev/v1/companies/20123456789", headers=headers)
data = res.json()Respuesta
200 OKapplication/json
{
"success": true,
"message": "Empresa.",
"data": {
"company": {
"ruc": "20123456789",
"business_name": "MI EMPRESA SAC",
"plan_type": "01",
"environment": "02",
"environment_name": "production",
"sending": "automatic",
"receipts": "individual",
"response": "wait",
"is_active": true,
"created_at": "2026-07-01T10:00:00-05:00"
}
}
}404 No encontradaapplication/json
No existe o no pertenece a tu cuenta.
{
"success": false,
"message": "Empresa no encontrada."
}