Skip to main content

Overview

Tesouro aggregates the most popular payment methods and providers and allows you to define the right payment method for each transaction. This enables bill pay, invoice payment links, and other payments for the organization’s customers.
The organization must be onboarded in order to accept payments.

Payment intent

The payment intent is the intention of a customer to execute a payment. In our system, a payment intent is an object that represents the payment itself. It is used to track the lifecycle of the payment flow. This gives you full control over the payment journey. A new payment intent is created automatically every time a payment link is created. The payment intent object can also be used to see the history of a specific payment.

Payment intent lifecycle

Each payment intent is allocated with a status that indicates its progress throughout the payment lifecycle, from its creation until its conclusion.
Overview of the payment intent lifecycle

Find an existing payment intent for an invoice

To check if there is an existing payment intent for a specific accounts receivable invoice, call GET /payment-intents?object_id=INVOICE_ID:
You can also query multiple invoices at once:
GET /payment-intents?object_id__in=INVOICE_1&object_id__in=INVOICE_2
The data array in the response contains all payment intents associated with the specified invoices.
After you have obtained the payment intent, you can use it to:

Track the payment intent

There are several ways to track the payment intent transition between statuses.

Webhooks

You can subscribe to the payment_intent.status_updated webhook to get notified of every change in the status of the payment intent. To subscribe to this webhook, call POST /webhook-subscriptions with the following request body, replacing the url with the URL of your webhook listener endpoint:
The events sent by Tesouro contain entity_id, object_type, and object_id, which can be used to identify the affected payment intent:

Get information about the payment intent

The payment intent ID received from the webhook can be used to check the progress of the actual payment, by calling GET /payment-intents/{payment_intent_id}:
The successful response contains information about the payment intent:

Get the payment intent history

You can check the full status transition history of a specific payment intent by calling GET /payment-intents/{payment_intent_id}/history:
The successful response returns one data item for each change in the payment intent status:

Payment methods

When the payment process is initiated, Tesouro allows the partner’s platform to control the available payment methods to be displayed to the payer on the payment page so they can select their preferred one during the payment act. Check the full list of payment methods Tesouro supports. The payment process can also be started through a payment link sent to the customer. This link can be customized and shared as many times as you want on any channel you prefer.