Skip to main content
Skip table of contents

User Guide: Authentication in the LRP Supplier API

English version

This document outlines the step-by-step process to authenticate with the LRP Supplier API.
The authentication flow consists of two stages:

  1. Authentication with the Auth Controller to obtain the first authorization token.

  2. Authentication with the corresponding controller (Customs, International, or Land) to obtain the second session token.


1. Authentication with the Auth Controller

To obtain the first token, authenticate with the Auth Controller via the /Token endpoint.

Endpoint:

CODE
POST /Token

Required Parameters:

Parameter

Description

User

Provided by the LRP Technology team

Password

Provided by the LRP Technology team

Expected Response:

If the credentials are valid, the endpoint will return an access token.
This token must be copied and used in the next step of the process.
The token is valid for 1 hour.

Example Response:

CODE
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9Ks...",
  "Expires": "07/11/2025 08:38 p. m.",
  "expires_in": 60
}

2. Authentication with the Integration Controller

After obtaining the first token, the next step is to authenticate with the specific controller you intend to integrate with.

Available Controllers:

  • Customs (Aduana)

  • International (Internacional)

  • Land (Terrestre)

Each controller has an authentication endpoint that requires the following parameters:

Endpoint:

CODE
POST /api/{NombreControlador}/Authentication

Required Parameters:

CODE
{
  "User": "string",
  "Password": "string",
  "Lrp": 0
}

Field

Description

User

LRP integration user.

Password

Corresponding password.

Lrp

LRP Code, available from the table LRP Systems.

📌 Important:

You no longer need to manually add the Bearer token in the header of each request.
Instead, use the “Authorize” button in the top-right corner of the Swagger UI documentation.

Clicking the "Authorize" button will open a window where you must paste the previously obtained token, preceded by the word Bearer.

image-20251107-194405.png

Example:

CODE
Bearer eyJhbGciOiJIUzI1NiIsIn...

Expected Response (Session Token):

If credentials and token are valid, you’ll receive a second session token.

CODE
{
  "Session": "e7e278d6-fc78-4bb1-b025-50a39b607092",
  "ValidResponse": true,
  "Message": [
    ""
  ],
  "Code": 0,
  "Response": "Successful Transaction."
}

3. Using the Tokens to Access the API

After both tokens are obtained, you can begin using the endpoints of the chosen controller.

The session token will be automatically applied by Swagger (thanks to the "Authorize" feature) in every request.

Example of a protected request:

CODE
GET /api/{NombreControlador}/Datos

✅ Conclusion

  • This two-step authentication process ensures secure access to the LRP Supplier API.

  • The first token is valid for 30 minutes, so it is recommended to immediately use it to obtain the session token and proceed with your requests.

Spanish version

Este documento describe el proceso paso a paso para autenticarse en el API de Proveedores de LRP.
El proceso de autenticación consta de dos etapas:

  1. Autenticación en el controlador Auth para obtener el primer token de autorización.

  2. Autenticación en el controlador correspondiente (Customs, International o Land) para obtener el segundo token de sesión.


1. Autenticación en el Controlador Auth

Para obtener el primer token, es necesario autenticarse en el Controlador Auth en el endpoint /Token.

Endpoint:

CODE
POST /Token

Parámetros requeridos:

Parámetro

Descripción

Usuario

Asignado por el área de Tecnología de LRP.

Contraseña

Asignada por el área de Tecnología de LRP.

Respuesta esperada:

Si las credenciales son correctas, el endpoint responderá con un token de acceso.
Este token debe ser copiado y utilizado en el siguiente paso del proceso.
Tiene una vigencia de 1 hora.

Ejemplo de respuesta:

CODE
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9Ks...",
  "Expires": "07/11/2025 08:38 p. m.",
  "expires_in": 60
}

2. Autenticación en el API de Integración

Después de obtener el primer token, el siguiente paso es autenticarse en el controlador específico al que se desea integrar.
Los controladores disponibles son:

  • Customs (Aduana)

  • International (Internacional)

  • Land (Terrestre)

Cada uno de estos controladores tiene un endpoint de autenticación que requiere la siguiente información:

Endpoint:

CODE
POST /api/{NombreControlador}/Authentication

Parámetros requeridos:

CODE
{
  "User": "string",
  "Password": "string",
  "Lrp": 0
}

Campo

Descripción

User

Usuario integrador de LRP.

Password

Contraseña correspondiente al usuario.

Lrp

Código del LRP, que puede obtenerse desde la plataforma LRP Systems.

Importante:
Ya no es necesario enviar el token de autorización en el encabezado (Header) de cada solicitud.
En su lugar, el token debe ingresarse utilizando el botón “Authorize”, ubicado en la esquina superior derecha de la documentación Swagger.

Al presionar el botón Authorize, se abrirá una ventana donde deberás ingresar el primer token obtenido en el paso anterior, precedido por la palabra Bearer.

image-20251107-194405.png



Por ejemplo:

CODE
Bearer eyJhbGciOiJIUzI1NiIsIn...

Respuesta esperada:

Si las credenciales y el token son válidos, el controlador responderá con un segundo token de sesión.

Ejemplo de respuesta:

CODE
{
  "Session": "e7e278d6-fc78-4bb1-b025-50a39b607092",
  "ValidResponse": true,
  "Message": [
    ""
  ],
  "Code": 0,
  "Response": "Successful Transaction."
}

3. Uso de los Tokens para Consultas en el API

Una vez obtenidos los dos tokens, ya se pueden realizar consultas a los diferentes endpoints del API correspondiente.

El segundo token será utilizado automáticamente por Swagger (gracias a la configuración en el botón Authorize) en cada solicitud que se realice.

Ejemplo de solicitud a un endpoint protegido:

CODE
GET /api/{NombreControlador}/Datos

Conclusión

Este proceso de doble autenticación garantiza la seguridad en la integración con el API de Proveedores de LRP.
Recuerda que el primer token tiene una vigencia de 30 minutos, por lo que se recomienda utilizarlo de inmediato para obtener el segundo token y realizar las consultas necesarias.


Fecha actualización
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.