API Access Token - via Refresh Token
This service has the function of generating an "Access Token" which will allow to generate a unique code "Nonce" for the Flex Form or to consume directly the APIs.
Environment | EndPoint | Method |
Development | POST | |
Pre-Production | POST | |
Production | POST |
Headers
Cabecera | Valor | Required |
Content-Type | application/json | Yes |
ALG-API-VERSION | API version to be used. Available values: 1618440906 | Yes |
"Content-Type":"application/json",
"ALG-API-VERSION":"1618440906",
Request
Parameter | Type | Long. | Description | Req. |
action | String | - | The intent of the merchant. In this case it is "authorize". | Yes |
grant_type | String | - | Type of request. In this case "refresh_token". | Yes |
client_id | String (AN) | 100 | ID assigned to the merchant. Value provided by Pay-me. | Yes |
client_secret | String (AN) | 100 | Secret assigned to merchant. Value provided by Pay-me. | Yes |
audience | String | - | Identificador único de las APIs Tokens y Charges a las que se solicita acceso. Valores disponibles: | Yes |
username | String (AN) | 100 | User of the merchant requesting access. Value provided by Pay-me. | No |
refresh_token | String (AN) | 100 | Value of the Refresh Token that will be used to generate more Access Tokens. | Yes |
scope | String | - | List of permissions you want to have with the Access Token. Values must be separated by space. Available values: create:token post:charges delete:charges | Yes |
{
"action":"authorize",
"grant_type":"refresh_token",
"username":"commerce@email.com",
"refresh_token":" OqLWq5BoSm3ZHbfaY_D3J_XuKB1TOdrHl7Ui_0sdLF1",
"audience":"https://api.dev.alignet.io",
"client_id":"yhaPE3jtHXHMKUZBBFr9QS1x1FaXxr",
"client_secret":"uTCetT3d4T-1NgXyTO66C0850xLJ5c7CwoyXm23NALxZ-MbwQxkqs1Q9ThwWfE",
"scope":"create:token"
}
Response
Parámetro | Descripción |
action | Process performed, in this case it is "authorize". |
success | Result of the operation: true: Processed successfully. false: Not processed successfully. |
access_token | Access Token required to consume the APIs. |
scope | Permissions enabled for the Access Token. |
expires_in | Access Token lifetime in seconds. |
token_type | Token type, at the moment only "Bearer" is used. |
authorization.meta.status.code | Code associated with the status of the operation. Available values: 00: In case of success} 01: In case of error |
authorization.meta.status.message_ilgn.locale | Configuration of the language used for the status code message. |
authorization.meta.status.message_ilgn.value | Message resulting from the process. |
{
"action":"authorize",
"success":true,
"access_token":"eyJhbGciOiJSUzI1NsInR5cCI6IkpXVCIsImtpZCI6IlVfR2ZLY.........",
"scope":"create:token",
"expires_in":86400,
"token_type":"Bearer",
"authorization":{
"meta":{
"status":{
"code":"00",
"message_ilgn":[
{
"locale":"es_PE",
"value":"Access Token creado"
}
]
}
}
}
}
Continue to API Revoke Refresh Token ➡️