Direct API

With the Direct API, the whole payment experience happens on your website. You build both the payment method selection page and the checkout page, and the customer completes the payment without being redirected to PayRetailers. It gives you full control of the design, in exchange for a bigger implementation effort.

How it compares

PaywallHosted Payment PagesDirect API
Payment method selection pageHosted by PayRetailersBuilt by youBuilt by you
Payment method checkout pageHosted by PayRetailersHosted by PayRetailersBuilt by you
Customer is redirectedYesYes, after selecting a methodNo
Endpoints usedCreate PaywallGet Payment Methods + Create TransactionCreate Transaction + Get Landing Info
Implementation effortLowMediumHigh

Choose the Direct API when you want the customer to stay on your site for the whole payment and you can build and maintain your own checkout pages.

Two features, depending on the payment method

The Direct API is made of two different features. Which one you use depends on the type of payment method:

Get Landing InfoDirect API JavaScript Library
Payment methodsAlternative payment methods (bank transfers, QR, cash vouchers, wallets)Credit cards
CountriesArgentina, Brazil, Colombia, Mexico and Peru (see the list below)Mexico only
What you getThe payment instructions, references, QR codes and logos as data, to display on your own checkout pageA card payment form that you embed on your page
Where to startThis pageDirect API JavaScript Library

The rest of this page covers Get Landing Info.

Before you start

  • You have your Shop ID and Secret Key. See Authentication.
  • Your server IP addresses are whitelisted by PayRetailers.
  • You have a public HTTPS endpoint to receive Notifications (notificationUrl).
  • The payment methods you want to offer support Get Landing Info (see Supported payment methods).

Direct API flow

Direct API flow: the customer selects a payment method, you create the transaction, request its landing info with the transaction ID and display the payment instructions on your checkout page.

Direct API flow

1. Create the transaction

When the customer has selected a payment method on your site, call Create Transaction from your server with that method, the amount and currency, the customer's details and your notificationUrl. To build the list of methods, you can use Get Payment Methods, as in Hosted Payment Pages.

The transaction is created with status PENDING. Instead of redirecting the customer to the checkout URL returned in the response, keep the transaction ID (uid) and continue with the next step.

2. Get the payment instructions

Call Get Landing Info with the transaction ID. The response contains everything the PayRetailers checkout page would show for that transaction:

BlockWhat it contains
amount, currencyThe amount and currency to pay.
expirationDateThe date and time until which the customer can pay.
referencesThe data the customer needs to pay, such as a payment reference, key or account number.
instructionsThe payment steps, already written in the transaction's language.
qrCodesThe QR code or barcode, when the method uses one, as an image and as raw data.
linksAdditional links for the payment method, such as the return URL.
logosThe logo of the payment method.

See Landing Info Response for the full description of each field.

3. Display the instructions on your checkout page

Show the customer, with your own design:

  • The amount and the payment deadline.
  • The references, with a copy button, so the customer can paste them in their banking app.
  • The QR code or barcode, if there is one.
  • The payment steps, in the order they are returned.
  • The payment method's logo, so the customer recognises it.

The customer then pays from their banking app, wallet or at a cash point, following your page.

4. Confirm the result

The transaction follows the standard transaction flow, and PayRetailers sends notifications to your notificationUrl.

🚧

Confirm the payment before fulfilling the order

Many methods (cash, bank transfer) are paid hours or days after the instructions are shown. Always confirm the final status from the notification or with Get Transaction by UID before releasing goods or crediting balance.

Supported payment methods

Get Landing Info is currently available for the following payment methods. For any other method, redirect the customer to the checkout URL returned by Create Transaction, as in Hosted Payment Pages.

CountryPayment methods
ArgentinaQR Code, Pago Fácil, Rapipago, MODO, Alias
BrazilPIX, PicPay, Boleto Rápido
ColombiaEfecty, Bre-B
MexicoSPEI
PeruYape, Plin, Interbank, BBVA, Scotiabank, QR, PagoEfectivo
📘

This list is not the same as the methods supported by Landing Info Customisation. That feature brands the PayRetailers checkout page; Get Landing Info lets you build your own.

Good to know

  • Instructions expire. Show the payment deadline (expirationDate) clearly and offer the customer a new payment if it has passed.
  • Use the QR data that suits you. You can display the QR image as it is, or generate it yourself from the raw data.
  • Keep a fallback. If Get Landing Info fails, you can still redirect the customer to the checkout URL returned by Create Transaction, so the sale is not lost.

Related


Did this page help you?