Before you begin

This guide assumes that you know how to:

Accept payments with Pix via Volt

Prepare the API

Pix via Volt requires the following data to process a payment successfully. Pass the following data in the client session, or in the payment request (for manual payment creation).

Parameter NameRequiredDescription
3-letter currency code in ISO 4217 format, e.g. USD for US dollars
  1. order
Details of the line items of the order

customerId is mandatory, and will be passed to Volt as payer -> reference.

  1. customer

A Brazilian document ID is required, and will be passed to Volt as payer -> documentId

orderId is required, it must be unique and will be passed to Volt as uniqueReference

  1. customer
  2. billingAddress

firstName will be used in payer -> name in the request to Volt

  1. customer
  2. billingAddress

lastName will be used in payer -> name in the request to Volt

Prepare the SDK for payments

Handle payment method

Pix via Volt requires instance of Redirect Manager in order to be presented to the user:

1
const manager = await headless.createPaymentMethodManager('VOLT_PIX')
typescript
copy

VOLT_PIX must be returned as PaymentMethod.type in the onAvailablePaymentMethodsLoad callback.

When the user has selected the payment method, call the start function. This function automatically:

  • opens a popup to present a loading indicator, then the payment method web page
  • shows an overlay on top of your page that prompts the user to focus on the popup
123
myButton.addEventListener('click', () => {    manager.start()})
typescript
copy

This code is intended solely for illustrative purposes. As many redirect payment methods share a common approach, it is recommended to centralize the implementation of these methods within your codebase. For a practical demonstration of how to achieve this, please refer to the guide on how to handle payment methods with redirect.

Go live

You don’t need to do anything particular to go live — just make sure to use production credentials.