Skip to main content
This guide is for an organization that acts as a distributor: it opens accounts for its customers, follows the compliance analysis of each one through webhooks and, once a customer is approved, operates on the customer’s behalf with its own credentials. The guide explains the flow and the concepts; the Onboard entity API reference lists every field, type and response. All examples use the sandbox base URL https://api.sandbox.trio.com.br.

1. How the organization model works

Two organizations take part in the flow:
  • Distributor organization: holds the API credentials and drives the flow for its customers.
  • Customer organization: created by the onboarding and used for the customer’s transactions.
One request creates the customer organization, its entity and its representatives. Trio then analyzes the customer, tells you the result through webhooks and, after approval, lets you operate on the customer organization by sending its org_id in the Trio-Target-Org-Id header. Your credentials never change: the header only changes which organization the request acts on.
See Acting on another organization for how the header is validated.

2. What you need

Onboarding is only available after Trio has created a distribution channel for your organization. To request one, contact Trio Support or your Trio Account Manager.
Before you call the API, have at hand:
  • Your distributor organization’s client_id and client_secret. Every request in this guide uses Basic Authentication with these credentials.
  • The customer’s company data: tax ID (CNPJ), name, annual revenue and average ticket.
  • The data of each company representative: name, tax ID (CPF), phone number and email.
  • The consent of the legal representative who authorizes opening the account: that representative’s CPF, the IP address and the date and time of the authorization.
  • The PDF documents your distribution channel requires for the company and for each representative. Step 5 explains which ones.

3. Create the onboarding

Send the company data, its representatives and the consent in one request:

Request fields

business_infos holds two monetary objects. Amounts are in cents (BRL 100.00 = 10000), so {"amount": 500000, "currency": "BRL"} is BRL 5,000.00. Each item of representatives describes one representative. The two compliance flags default to false when omitted. consent records who authorized the account opening and when:

Example request

4. Read the response

Onboarding creation is synchronous: the response returns the identifiers of everything that was created, and echoes the business_infos, consent and representatives you sent.
Store org_id, entity_id, external_id, tax_number and the current status in your system. You need org_id for every call on the customer’s behalf, and the full set makes it easy to reconcile your records with Trio.

Required documents

required_documents appears in two places, based on the documents configured for your distribution channel:
  • data.required_documents: documents the company must provide, such as company_contract, power_of_attorney and financial_statement.
  • data.representatives[].required_documents: documents each representative must provide, typically identification.
Both fields are null when no document is required. They tell you exactly what to upload in the next step.

5. Upload the required documents

Depending on your distribution channel, compliance may ask for supporting documents for the entity, for its representatives or for both. Upload them after the onboarding is created, using the identifiers from the response:
The request is multipart/form-data with the same Basic Authentication as the onboarding creation. Only PDF files are accepted. Each request uploads one document, so repeat the call for every required document of the entity and of each representative. See the Upload onboarding document API reference.

Upload a financial statement for the entity

Upload an identification document for a representative

Response

6. Complete the liveness check

After creation, the onboarding enters validation. Each representative must complete a facial recognition (liveness) check before the account can be opened. Trio provides the link for it as the representative’s liveness_link; send the link to the representative, who completes the check through it.

7. Compliance analysis

Once the liveness check is done, the customer’s information goes to compliance analysis. You do not need to poll the API for the result: Trio sends an event in the entity category whenever the compliance status of an entity created through onboarding changes. The next step describes these events; the webhook events catalog lists all of them.

8. Onboarding webhooks

Three events track the analysis:
Keep the customer in an onboarding state until you receive entity.approved, then enable the operations your integration supports. On entity.rejected, store the reason from the payload so the customer’s case can be handled.

Entity in review

entity.in_review tells you the entity entered the analysis stage. When applicable, it also carries the representative’s liveness_link.

Entity approved

entity.approved tells you compliance approved the entity. From this event on, your application can treat the customer organization as ready for the operations supported by the product.

Entity rejected

entity.rejected tells you compliance rejected the entity. The reason field describes why.

9. Operate on the customer’s organization

Once the entity is approved, make calls on the customer’s behalf with your own credentials and the customer’s org_id in the header:
For example, to list the entities of the customer organization:
Trio validates the access on every request: if your organization has no access to the target organization, the API returns 403. Access is configured at the organization level and must be enabled for your integration.

Retrieve the customer’s bank account

After entity.approved, the customer’s bank account is typically available within a few minutes. It is not created at the same instant as the approval event, so do not assume the account ID is available right away. To get it, call List bank accounts with the customer’s org_id in Trio-Target-Org-Id:
Collect the bank account id from the response: it is the bank_account_id you send when creating receivables and payments on the customer’s behalf.

Next steps