/clients/:ruc
GET /api/clients/:ruc
Authorization: Bearer <token>
verificarAutenticacion
verificarAutenticacion
– Verifica token JWTvalidateGetClient
– Valida el parámetro ruc
validateRequest
– Manejo de errores de validaciónParámetro | Tipo | Requerido | Descripción |
---|---|---|---|
ruc | number | ✅ | Número de RUC del cliente a consultar |
{
"status": "success",
"code": "CLIENT_FOUND",
"msg": "Cliente encontrado.",
"data": {
"Name": "string",
"Ruc": number,
"Address": "string",
"telephone": number,
"email": "string",
"credit": "string",
"state": "string"
}
}
{
"status": "error",
"code": "MISSING_FIELD",
"msg": "El parámetro 'ruc' es obligatorio."
}
{
"status": "error",
"code": "AUTH_ERROR",
"msg": "Acceso no autorizado. Se requiere token válido."
}
{
"status": "error",
"code": "NOT_FOUND",
"msg": "No se encontró cliente con RUC {ruc}."
}
{
"status": "error",
"code": "SERVER_ERROR",
"msg": "Ha ocurrido un error inesperado al buscar el cliente. Intente de nuevo más tarde."
}
curl --location -g --request GET 'https://back-prima-s-a.onrender.com/api/clients/{{ruc}}' \
--header 'User-Agent: insomnia/10.3.0' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3NjI0ZjkwNzY2OWM5MDZjYTM0YThkZSIsInJvbCI6ImFkbWluIiwiaWF0IjoxNzM4NjI4MjgxLCJleHAiOjE3Mzg2NTcwODF9.0or08xMGWjpppL1Lm2dGM6yX-5Y6ozETnKFwpXPgxxE'
{}