Skip to main content
Start on your backend. Use credentials for the same environment throughout authentication, nonce creation and payment processing.

Business requirements

For businesses onboarding in Peru:
  • A registered business with RUC 10 or 20.
  • An existing website or one under development; active social profiles if the website is not yet available.
  • HTTPS on the website.
  • A bank account under the registered business name.
  • A developer responsible for the integration.

Authenticate on your backend

Generate an Access Token using the authentication reference. Keep credentials and access tokens on your backend. Only pass the temporary nonce needed by Flex to the frontend.

Generate a nonce

Generates a Nonce time to start Alignet One Flex at the front.
That value should be requested from backend using a Bearer Token valid.

Endpoint

endpoint
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 with nonce.

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 receiving nonce, send them to the front and select them at the initiation of the component with the payload.

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 nonce from 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 nonce if 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.
The nonce does not replace backend validation of the result. After response from Flexconfirm the status of operation with your backend.

2. Integrate Flex

Load the libraries, build the payload and mount your first payment form.