Skip to main content
Every notification Trio sends has the same JSON structure: an envelope that says which event happened and to what, and a data object with the details of the resource involved. This page explains the envelope; the Events page lists what data contains for each category.

The envelope

The examples on the Events page carry a few more envelope fields, such as context_id and context_type. They are not needed to handle a notification.

Reading a notification

The notification below reports a cash-in document that settled: category and type say what happened, ref_id says to which document, and data carries the document itself. Amounts are in cents (BRL 100.00 = 10000), so this payment is BRL 1.00.
To handle it:
  1. Route on category and type. Together they name the event, in_document.settled here.
  2. Find your own record with ref_id, or with data.external_id when you sent one in the request that created the resource.
  3. Update that record from data. If you prefer to read the current state from the API, fetch the resource by ref_id.
Trio retries a notification your endpoint does not acknowledge in time, so the same event can arrive twice. Treat the combination of ref_id, category and type as the key of a notification and skip the ones you have already handled.

Next steps