curl --request POST \
--url https://auth.preprod.alignet.io/nonce \
--header 'ALG-API-VERSION: <alg-api-version>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "create.nonce",
"audience": "https://api.preprod.alignet.io/",
"client_id": "your_client_id",
"scope": "post:charges"
}
'import requests
url = "https://auth.preprod.alignet.io/nonce"
payload = {
"action": "create.nonce",
"audience": "https://api.preprod.alignet.io/",
"client_id": "your_client_id",
"scope": "post:charges"
}
headers = {
"ALG-API-VERSION": "<alg-api-version>",
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'ALG-API-VERSION': '<alg-api-version>',
Authorization: '<authorization>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'create.nonce',
audience: 'https://api.preprod.alignet.io/',
client_id: 'your_client_id',
scope: 'post:charges'
})
};
fetch('https://auth.preprod.alignet.io/nonce', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.preprod.alignet.io/nonce",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'create.nonce',
'audience' => 'https://api.preprod.alignet.io/',
'client_id' => 'your_client_id',
'scope' => 'post:charges'
]),
CURLOPT_HTTPHEADER => [
"ALG-API-VERSION: <alg-api-version>",
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://auth.preprod.alignet.io/nonce"
payload := strings.NewReader("{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ALG-API-VERSION", "<alg-api-version>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.preprod.alignet.io/nonce")
.header("ALG-API-VERSION", "<alg-api-version>")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.preprod.alignet.io/nonce")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ALG-API-VERSION"] = '<alg-api-version>'
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}"
response = http.request(request)
puts response.read_body{
"action": "create.nonce",
"success": true,
"nonce": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.........",
"scope": "post:charges",
"expires_in": 30,
"nonce_creation": {
"meta": {
"status": {
"code": "00",
"message_ilgn": [
{
"locale": "es_PE",
"value": "Codigo Nonce creado"
}
]
}
}
}
}Generate Nonce
Generates the temporary Nonce required to initialize Alignet One Flex. Consume this endpoint from your backend using a valid Bearer Token. See also API Nonce.
curl --request POST \
--url https://auth.preprod.alignet.io/nonce \
--header 'ALG-API-VERSION: <alg-api-version>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "create.nonce",
"audience": "https://api.preprod.alignet.io/",
"client_id": "your_client_id",
"scope": "post:charges"
}
'import requests
url = "https://auth.preprod.alignet.io/nonce"
payload = {
"action": "create.nonce",
"audience": "https://api.preprod.alignet.io/",
"client_id": "your_client_id",
"scope": "post:charges"
}
headers = {
"ALG-API-VERSION": "<alg-api-version>",
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'ALG-API-VERSION': '<alg-api-version>',
Authorization: '<authorization>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'create.nonce',
audience: 'https://api.preprod.alignet.io/',
client_id: 'your_client_id',
scope: 'post:charges'
})
};
fetch('https://auth.preprod.alignet.io/nonce', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.preprod.alignet.io/nonce",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'create.nonce',
'audience' => 'https://api.preprod.alignet.io/',
'client_id' => 'your_client_id',
'scope' => 'post:charges'
]),
CURLOPT_HTTPHEADER => [
"ALG-API-VERSION: <alg-api-version>",
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://auth.preprod.alignet.io/nonce"
payload := strings.NewReader("{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ALG-API-VERSION", "<alg-api-version>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.preprod.alignet.io/nonce")
.header("ALG-API-VERSION", "<alg-api-version>")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.preprod.alignet.io/nonce")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ALG-API-VERSION"] = '<alg-api-version>'
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"create.nonce\",\n \"audience\": \"https://api.preprod.alignet.io/\",\n \"client_id\": \"your_client_id\",\n \"scope\": \"post:charges\"\n}"
response = http.request(request)
puts response.read_body{
"action": "create.nonce",
"success": true,
"nonce": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.........",
"scope": "post:charges",
"expires_in": 30,
"nonce_creation": {
"meta": {
"status": {
"code": "00",
"message_ilgn": [
{
"locale": "es_PE",
"value": "Codigo Nonce creado"
}
]
}
}
}
}Headers
Version del API a usar.
Bearer Token vigente generado previamente desde /token.
Body
Accion a ejecutar.
"create.nonce"
URL base del API Orquestador segun el ambiente configurado.
https://api.preprod.alignet.io/, https://api.alignet.io/ "https://api.preprod.alignet.io/"
Identificacion del cliente.
"your_client_id"
Permisos a solicitar.
"post:charges"
Response
Nonce generado correctamente.
Accion ejecutada.
"create.nonce"
Indica si el proceso se realizo correctamente.
true
Objeto que contiene metadatos del flujo ejecutado.
Show child attributes
Show child attributes
Token temporal a usar en la inicializacion de Alignet One Flex.
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
Permisos solicitados.
"post:charges"
Tiempo de expiracion del nonce en segundos.
30

