Skip to main content
Skip table of contents

API de Seguridad

El API de Seguridad permite generar un Access Token para ser usado luego por los distintos APIs disponibles.

REQUEST

Path

Method: POST

Headers

Para todos los métodos de pagos, se enviará los siguientes parámetros en la cabecera de la petición:

Field

Description

Accepted Value

Type

Obligatorio

ALG-API-VERSION

Versión del API a usar

Cadena alfanumérica

String

NO

Body

Field

Description

Accepted Value

Type

Obligatorio

action

Acción a ejecutar

  • authorize

String

SI

grant_type

Método de autorización

  • client_credentials

String

SI

audience

Url base del API a utilizar segun API Orquestador

{{base}}

String

SI

client_id

Identificación del cliente

String

SI

client_secret

Secreto del cliente

String

SI

scope

Permisos a solicitar

create:token

  • post:charges

  • get:charges

  • delete:charges

String

SI

JSON
{
    "action": "authorize",
    "grant_type": "client_credentials",
    "audience": "https://paymentapi.preprod.alignet.io",
    "client_id": "WDqE4tFbhvzm5XJnnTYcPUNQGQMTg8P4",
    "client_secret": "rzBZjHn0lWb0xMPzqOiBAuznzlAq23LfsFEr2p4Rw7ezWzosxpt1Z1mpp8dt8zlR",
    "scope": "create:token post:charges get:charges delete:charges"
}

RESPONSE

Field

Description

Accepted Value

Type

Obligatorio

action

Acción a ejecutar

  • authorize

String

SI

success

Indica si el proceso se realizó correctamente

Cadena alfanumérica:

  • true

  • false

String

SI

access_token

Token para usar en las APIs

Cadena Alfanumérica

String

NO

scope

Permisos a solicitar

create:token

  • post:charges

  • get:charges

  • delete:charges

String

NO

expires_in

Tiempo de expiración del Token en segundos

Cadena numérica

String

NO

token_type

Tipo de Token

  • Bearer

NO

authorization

Objeto que contiene metadados del flujo ejecutado

 

Object

SI

authorization.meta

Objeto que contiene metadados del flujo ejecutado

 

Object

SI

authorization.meta.status

Objeto que contiene el resultado del flujo ejecutado

 

Object

SI

authorization.meta.status.code

Código que representa el resultado del flujo ejecutado

Cadena numérica

String

SI

authorization.meta.status.message_ilgn

Objeto que contiene el mensaje resultante del flujo

 

Object

SI

authorization.meta.status.message_ilgn.[].locale

Localidad a nivel de lenguaje para el mensaje del flujo ejecutado

Cadena alfanumérica

String

SI

authorization.meta.status.message_ilgn.[].value

Mensaje resultante del flujo ejecutado

Cadena alfanumérica

String

SI

Ejemplo

JSON
{
    "action": "authorize",
    "success": true,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2F1dGguYWxpZ25ldC5pbyIsInN1YiI6ImJDWG5TOHRqVWpiaTdKWTRVQW1scDVBakg4OEVDTlZOIiwiYXVkIjoiaHR0cHM6Ly84ZWZ0Z3BoOWthLmV4ZWN1dGUtYXBpLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tIiwiaWF0IjoxNzA2ODE1NzkzLCJleHAiOjE3MDY4MjQzOTMsImF6cCI6ImJDWG5TOHRqVWpiaTdKWTRVQW1scDVBakg4OEVDTlZOIiwic2NvcGUiOiJjcmVhdGU6dG9rZW4gYXBpLXRlc3Q6Y3JlYXRlOnRva2VuIiwiZ3R5IjoiY2xpZW50X2NyZWRlbnRpYWxzIn0.pruy3-6luVULktqox86kg7ibQKk0SpZgxR1re8e94rjXT-h1jlpa9xJLnmhorjY8786q26k8WsSyDLlOAuM1ZmRjBTwV7Gdq5RktfQD0fZLLKSyUcsNvF9_SmduBsi3hkHxSjfy70ERtFr9BYUTic7Z7d6anL67AxpC9G6sAQ3xilzpQXV82eUc2aagXhZo8zQjI-hEOG4Be7Vm9G5_NX5pb8MU7IRZcZ7mOan_EG4fSDD0wwZbxIipYabLEZIMH-r9ghrWoHMJGklphR26n1sTgRro0qHZj-CHcgSLZFiPa-s3BwQjC9qJSj9rbi-i8o6g3PlivI6XEh2-M5T7xI7xiU_4Di91l_SvY5uca5J1YwNZJ3D18pgCyZXXjb704ICreFYRvBdd36rHumDhFVW5iXva0yQmpHsP3VtS0ABCzDaMAalVXW7fQv-Mf3epbJptglTsNVlV9HSnP_kFRJ1T3DDdyPV0pR61JlC_08ouN9VKvS0sfHfEnSJL9jwhugHSRgm5owN5kOY0xxifffoeivLVzMGuhq5iPWMVjGT7Yg4fCJuXOFoSw4Dk9xVVGlj6xrw3azPvve4JzEqN_Tz3hph5X9a5O4hCYvdqYukzFm8EPJ4Q9oGrASKLU2IccjLBpKVWbAi0Hws5zH7ZFMGLmTWDUW92RSxz4kAElauY",
    "scope": "create:token api-test:create:token",
    "expires_in": 8600,
    "token_type": "Bearer",
    "authorization": {
        "meta": {
            "status": {
                "code": "00",
                "message_ilgn": [
                    {
                        "locale": "es_PE",
                        "value": "Access Token creado"
                    }
                ]
            }
        }
    }
}
JavaScript errors detected

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

If this problem persists, please contact our support.