That value should be requested from backend using a
Bearer Token valid.
Endpoint
endpoint
production
Production
Before calling this endpoint, it generates a
Access Token with Authentication. The token should be sent to the head Authorization.Required range
Define permission associated withnonce.
post: charges
Retirement Flex to create jobs and authorizations.
Bearer Token
The token sent at
Authorization have been valid and have been authorized to apply for this permission.Request
Leaders
Body
The value of
audience have to coincide with the environment that you will use to allow payment: https://api.preprod.alignet.io/ production or production https://api.alignet.io/ for production.Example (JSON)
Example (cURL)
Answer
Body
Example (JSON)
Using Nonce in Flex
After receivingnonce, send them to the front and select them at the initiation of the component with the payload.
Recommended flow
1
Generates Access Token
To be API Security from backend.
2
Requests Nonce
Send
action, audience, client_id and scope at endpoint POST /nonce.3
Initiates Flex
Use
nonce in FlexPaymentForms with payload and payment.4
Valids result
Confirms the operation from backend using notifications or API Consultation.
good practice
- Requests
noncefrom backend. - Use the same environment for
auth,audiencebookstores Flex and apis paid. - Don’t explain
client_id, tokens or sensitive metadata in public login. - Generates a new
nonceif the previous expires before initiation Flex. - Control reattempts to avoid multiple unnecessary applications.
Common errors
400 Bad Request
The body’s incomplete,
action and / or audience That’s bad.401 Unauthorized
The
Bearer Token did not have been sent, expired or have an incorrect format.403 Forbidden
The token does not have the necessary scope to apply for
nonce.5xx Error
A temporary misservice happened. Retry with a controlled backend.
Next step
Include library and basic styles
It continues with the inclusion of CSS and JS of the environment before starting the form.

