Skip to main content
This guide explains the onboarding flow for an integration in which an organization acts as an distributor for its customers’ organizations. The process allows the distributor organization to submit the data required to open the customer’s account, track the Compliance analysis through webhooks and, once approved, perform operations on behalf of the customer’s organization.
Important: this guide explains the flow and the concepts involved. To check all available fields, types, and responses, see the onboarding creation API reference.

1. How the organization model works

In this model, there are two main parties:
  • Distributor organization: the organization that holds the API credentials and controls the flow for its customers.
  • Customer organization: the organization created during onboarding, which will be used for the customer’s transactions.
The flow can be summarized as follows:
The distributor organization continues to use its own credentials. To perform an operation on a customer’s organization, simply provide the target organization’s identifier in the Trio-Target-Org-Id header. Also see Acting on another organization.

2. Creating the onboarding

Onboarding is created through the endpoint:
In Sandbox:
Authentication uses Basic Authentication, with the distributor organization’s client_id and client_secret.

Required data

To start onboarding, send the company’s data, the representative’s data, and the consent data. Within business_infos, information such as the following is provided:
  • annual revenue;
  • average ticket.
The representative must have:
  • name;
  • tax ID (CPF);
  • phone number;
  • email.
The consent must have:
  • the tax ID (CPF) of the person responsible for the consent;
  • IP address;
  • date and time of the authorization.

3. Creation example

Monetary values are sent in cents. For example:
represents R$ 5,000.00.

4. What happens after creation

Onboarding creation is synchronous. After the request is processed, the API returns the main identifiers of the structure that was created, including:
  • entity_id;
  • org_id;
  • company_id;
  • external_id;
  • tax_number;
  • status.
Example:
Best practice: save the org_id, entity_id, and external_id in your system. The org_id will be used later to perform operations on the customer’s organization.

5. Liveness step

After creation, onboarding moves on to the validation process. The representative needs to complete the facial recognition (liveness) check required to open the account. Example:
The customer must use this link to complete the facial recognition step.

6. Compliance analysis

Once liveness is completed, the customer’s information moves on to Compliance analysis. The distributor organization does not need to keep polling the API to find out whether the analysis has finished. Tracking should be done through entity webhooks. Events in the entity category are sent whenever the Compliance status of an entity created through onboarding changes. See the Entity events reference.

7. Onboarding webhooks

The main events related to onboarding are:

entity.in_review

Indicates that the entity has entered the analysis stage. When applicable, the event also contains the representative’s liveness_link.

entity.approved

Indicates that the entity was approved by Compliance and is ready to operate.
From this event onward, your application can consider the customer’s organization ready for the operations supported by the product.

entity.rejected

Indicates that the entity was rejected by Compliance. In this case, the event contains a reason field describing the reason for the rejection.

8. Using the customer’s organization

Once onboarding has been approved, the distributor organization can make calls on behalf of the customer’s organization. To do this, use the same credentials as the distributor organization and provide the customer’s org_id in the header:
Example:
In this scenario:
Access is validated by Trio on every request. If the distributor organization does not have access to the specified organization, the API returns 403.
Important: access to the organization is configured at the organization level and must be enabled for the integration.

9. Complete flow

The complete flow can be understood as follows:

10. Integration recommendations

Save the identifiers

After POST /onboarding, store at least the following in your system:
  • external_id;
  • org_id;
  • entity_id;
  • company_id;
  • tax_number;
  • current status.
This makes it easier to reconcile your system with Trio.

Use external_id as your system’s reference

The external_id should be a reference that lets you easily identify the customer within your application. Example:
or:
update the corresponding status in your system.

Only enable operations after approval

Keep the customer in an onboarding state while Compliance is analyzing the entity. After receiving:
the customer can move on to the operations supported by the integration.

Handle rejections

When you receive:
store the reason returned by the webhook so the customer’s case can be handled appropriately.

References


Retrieving the bank account after approval

Once the entity is approved (entity.approved), the customer’s bank account is typically made available within a few minutes. It is not created at the exact same instant as the approval event, so you should not assume the account identifier is available immediately. To retrieve it, call the list virtual accounts endpoint, passing the customer’s org_id in the header:
Use this call to list the virtual accounts created for the customer’s organization and collect the account identifier you’ll need in order to perform transactions on their behalf. This guide is also available in Portuguese: /guides/onboarding-guide-pt-br.