Skip to main content
Pix biometrics allows your customers to authorize Pix payments using biometric authentication (WebAuthn/FIDO) instead of being redirected to their bank app each time. The customer authorizes once at their bank to create an enrollment, registers their biometric credential, and from that point on can authorize payments with a fingerprint or face scan directly in your application. The flow consists of two main phases:
  1. Enrollment — a one-time setup where the customer links their bank account and registers a biometric credential.
  2. Payment — creating and authorizing payments using the registered biometric credential.
All examples use the sandbox environment (https://api.sandbox.trio.com.br). In production, use https://api.trio.com.br.

Endpoints

For complete endpoint documentation, see the Biometrics API Reference.

Step 1: Device Setup

Before interacting with the biometrics API, you need to identify the customer’s device. Collect the device information using a fingerprinting library such as FingerprintJS and send it to the API.

Create Device

The load_enrollments parameter, when set to true, includes the device’s existing enrollments in the response. This is useful to determine if the customer already has an active enrollment and can skip directly to the payment flow. If the device already exists (matched by fingerprint and counterparty_tax_number), the existing device is returned. For complete request and response details, see the Find or Create Device API reference.

Step 2: List Participants

Retrieve the list of available banking participants (institutions) that support biometric enrollment. You can optionally load enrollment information for each participant to determine which flow the customer needs. A single request that returns participants with enrollment data attached. Enrolled participants appear first in the list.
Each participant in the response will include:
  • enrolled? — whether the customer has an active enrollment with this participant
  • enrollment — the enrollment details (if enrolled)
This lets you immediately determine which flow each participant requires: For details, see the List Participants API reference.

Option B: Separate requests

You can also fetch participants and enrollments independently:
  1. GET /biometrics/participants?device_id={device_id} — list all participants
  2. GET /biometrics/enrollments?device_id={device_id} — list existing enrollments
Then match them on your end. This approach gives you more flexibility if you want to cache the participant list (which is the same for every user) and only fetch enrollments per user.
Participants are synchronized hourly with the Open Finance environment, and unstable participants are proactively disabled. If you choose to cache the participant list, be aware it may become out of sync.
For details, see List Enrollments.

Step 3: Enrollment Registration

When a customer selects a participant and has no active enrollment, you need to create one. This is a one-time process per participant.

3.1 Create Enrollment

Parameters:
  • device_id — the device ID from Step 1
  • participant_id — the participant chosen by the customer
  • return_to_url — where to redirect after biometric registration is complete
  • external_id — (optional) your internal reference
  • account_info — (optional) suggested bank account. The bank may accept or ignore this suggestion. If the bank returns a different account, the enrollment will be blocked
The response includes a redirect_url. Redirect the customer to this URL to start the bank authorization flow. For complete details, see the Create Enrollment API reference.

3.2 Bank Authorization

After redirecting, the customer authorizes the enrollment in their banking app. During this step:
  1. The customer is redirected to their bank
  2. The customer authorizes the biometric enrollment
  3. The bank redirects the customer to Trio’s whitelabel biometric registration page
  4. The customer registers their biometric credential (fingerprint or face)
  5. After completion, the customer is redirected to your return_to_url
The biometric registration (WebAuthn) is restricted to Trio’s domain due to security requirements, so this step is handled automatically through a whitelabel page.

3.3 Enrollment Webhooks

Listen for enrollment status webhooks with the category pix_biometrics_enrollment: Authorized — the enrollment is ready for payments:
Once you receive the authorized webhook, the enrollment is complete and you can create payments.

Enrollment Lifecycle


Step 4: Create Payment

Once the customer has an active enrollment, you can create payments that will be authorized using their biometric credential.

4.1 Create Payment from Enrollment

Using the enrollment_id from the active enrollment, create a payment:
Required fields:
  • entity_id — your entity ID
  • virtual_account_id — the virtual account that will receive the funds
  • amount — amount in cents (e.g., 1500 = BRL 15.00)
  • description — payment description
Optional fields:
  • external_id — your internal reference for reconciliation
For complete details, see the Create Payment API reference.

4.2 Get Authorization Options

Retrieve the FIDO authorization options needed for the WebAuthn authentication:
The response contains a public_key_encoded value — a JSON-encoded string with the WebAuthn publicKeyCredentialRequestOptions. You will pass this to the auth widget in the next step. For details, see the Get Authorization Options API reference.

Step 5: Authorize Payment with Biometrics

To authorize the payment, the customer must perform a WebAuthn authentication using Trio’s auth widget iframe. This iframe overlay handles the credentials.get WebAuthn operation on Trio’s domain.

5.1 Set Up the Auth Widget

Embed the iframe positioned over a button element in your page:
The iframe is transparent and overlays the button, so when the customer clicks “Authorize Payment”, the click is captured by the iframe and triggers the WebAuthn operation.
The allow attribute is required for WebAuthn to work inside the iframe.

5.2 Communication Protocol

The widget communicates via postMessage. All messages from the widget include source: "trio-biometrics-sdk". 1. Wait for the iframe to load:
2. The customer clicks the button. The WebAuthn prompt appears (fingerprint scanner, face recognition, etc.). 3. On success, the widget returns the FIDO assertion credential in e.data.credential.

5.3 Send the Authorization

Take the credential from the widget response and send it to authorize the payment:
For complete details, see the Authorize Payment API reference.

Payment Webhooks

After creating a payment, you will receive initiation_document webhooks for each status change. You can also listen to Pix cash-in webhooks for the final settlement confirmation. All payment webhooks share the same initiation_document category and include the full payment data. The type field indicates the current status.

Payment Lifecycle

Webhook Examples

initiation_document — created

The payment is waiting for the customer to authorize via biometrics (WebAuthn).

initiation_document — awaiting_payment

Biometric authorization is complete. The bank is processing the payment.

initiation_document — settled

Payment completed successfully. Funds have been transferred.

End-to-End Flow Summary

Steps 4a–4c only happen once per participant. After enrollment, the customer goes directly from step 5 onwards for subsequent payments.