Skip to main content
On this page

This page includes the steps necessary to integrate PSE using the payment widget.

Use the Purchase V2 endpoint for the PSE widget integration.

Integrate PSE with the widget#

The widget flow creates an order before processing a payment.

1. Create an order_token

To make a purchase, you must create a DEUNA order.

Make a request to the Create an Order endpoint.

The API returns an order_token, which is used throughout the entire flow.

2. Create user

Create a user with DEUNA to get an authorization token to perform the purchase later.

Make a request to the Create a User endpoint.

The API returns a user token, which is required to follow the next steps.

If the email does not exist, then a new user is created.

If the email used already exists:

  1. The API returns the message user already exists.
  2. Make a request to the Send an OTP endpoint and obtain a OTP.
  3. Make a request to the log in with OTP endpoint and obtain a fresh user token.
  4. You can now use thetoken for the next steps.

3. Make a PSE purchase

Make a request to the Purchase V2 endpoint.

The PSE purchase must have the information collected from the PSE form filled by the user, such as:

  • Full name
  • Document number
  • Document type
  • Phone number
  • Person type (natural or legal)
  • Bank
  • Callback URL to redirect the user to your page

4. Redirect the user

After performing the purchase, the API responds with the provider redirect in next_action.

  1. Take the redirect URL from next_action.
  2. Redirect the user to the URL.
  3. Wait for the user to complete the payment.

    The User completes the payment in PSE

  4. Wait for the widget to confirm the payment.