> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overdue reminders

> Learn how to send automated reminders about overdue invoices to customers.

## Overview

When an invoice is past due, it is a good idea to send an email reminder to the counterpart and suggest alternative payment options. With Tesouro API, organizations can customize the contents of overdue reminders and the grace period after which these reminders are sent. Reminders can be configured on a per-invoice basis, as well as shared between multiple invoices.

## How overdue reminders work

An overdue reminder is sent if the following conditions are met:

* the counterpart has not paid the invoice in full before the due date,
* the invoice has `overdue_reminder_id` specified (see below),
* the specified number of days passes after the invoice due date,
* counterpart setting `reminders_enabled` is `true`.

Overdue reminders are sent to the email address of the counterpart's [default contact](/finops/guides/common/counterparts/contacts#default), which gets saved in the `counterpart_contact.email` field of the invoice.

All email reminders are sent from the `noreply@tesouro.com` email address by default. You can customize the email domain name (`@domain.com`) by [configuring a mailbox](/finops/guides/advanced/mailboxes) for the organization. You can also customize the email sender name and username by updating your Tesouro partner settings.

## Configure overdue reminders

To use overdue reminders, you need to create a *reminder configuration* and include it when creating an invoice.

### 1. Create an overdue reminder configuration

To create an overdue reminder, call `POST /overdue-reminders` with the following request body. You must include a name for the reminder configuration, the number of days after the invoice due date to send the reminder, the email subject, and the email body in the request object.

```sh expandable lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/overdue-reminders' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "name": "Overdue reminders sent after 2 and 7 days",
       "terms": [
         {
           "days_after": 2,
           "subject": "Invoice {invoice_number} from {entity_name} is past due",
           "body": "Dear {contact name}\n\n,Thank you for doing business with us!\nOur records indicate that we have not received the full payment for invoice {invoice_number} which was due on {due_date}. The amount due is {amount_due}.\nIf you have already paid this invoice, please ignore this notice. Otherwise, please send the payment as soon as possible.\nIf you have any questions or want to arrange an alternative payment method, please do not hesitate to contact us at {entity_email}.\nBest regards,{entity_name}"
         },
         {
           "days_after": 7,
           "subject": "Invoice {invoice_number} from {entity_name} is past due",
           "body": "Dear {contact name}\n\n,Thank you for doing business with us!\nOur records indicate that we have not received the full payment for invoice {invoice_number} which was due on {due_date}. The amount due is {amount_due}.\nIf you have already paid this invoice, please ignore this notice. Otherwise, please send the payment as soon as possible.\nIf you have any questions or want to arrange an alternative payment method, please do not hesitate to contact us at {entity_email}.\nBest regards,{entity_name}"
         }
       ]
     }'
```

<Info>
  Each reminder configuration can only contain a maximum of three reminders for an overdue invoice.
  Attempting to configure more than three overdue reminders will throw an error.
</Info>

The response contains the ID assigned to this configuration. You will need to specify this ID later when creating invoices.

```json lines theme={null}
{
  "id": "0cdb03db-b71c-4bac-96f5-360a2913953e",
  "name": "Overdue reminder after 5 days",
  ...
}
```

### 2. Specify the overdue reminder configuration for an invoice

When [creating a new invoice](/finops/guides/accounts-receivable/invoices/create) or updating an existing draft invoice, you can use the `overdue_reminder_id` field to specify the desired overdue reminder configuration for this invoice:

```sh lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/receivables' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json'
     -d '{
        "type": "invoice",
        "overdue_reminder_id": "0cdb03db-b71c-4bac-96f5-360a2913953e",
        ...
     }'
```

<Info>
  Tesouro allows organizations to update an overdue reminder's configuration when assigned to an
  invoice. However, the configuration on the assigned invoice is frozen whenever the invoice is
  issued, and any changes to the overdue reminder's configuration will not affect the invoice's
  reminders. For more information on updating overdue reminders, see [`PATCH /overdue-reminders/   {overdue_reminder_id}`](/finops/reference/openapi/overdue-reminders/patch-overdue-reminders-id).
</Info>

## Preview an overdue reminder email

After configuring an overdue reminder, you can preview the reminder email before sending it out. This step can be helpful when troubleshooting email template layouts for a payment reminder to ensure the final presentation aligns with your template design.

To preview an overdue reminder template, call `POST /receivables/{receivable_id}/preview`:

```sh lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/receivables/411dc6eb...6289b3/preview' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "subject_text": "Regarding your overdue invoice #{invoice_number}",
       "body_text": "Dear {contact_name},\n\nKindly be aware that your invoice #{invoice_number} is now 4 days overdue!\nPer our agreement, this invoice was due on {due_date}. This means that a late payment fee may be applied if the a proof of payment is not presented in the next 10 days\nPlease pay the balance of {amount_due} (invoice #{invoice_number}).\n\nFor any questions or concerns, please don’t hesitate to get in touch with us at {entity_email}. We look forward to serving you again and wish you all the best!",
       "type": "final_reminder"
     }
```

The `type` field determines the type of receivable document to be previewed and is a required field for previewing overdue reminders. For overdue reminders, the value of the `type` field must be `final_reminder`.

## Manually trigger overdue reminders

After configuring an overdue reminder and assigning it to an invoice, you can manually trigger it to send a reminder email to a counterpart. Tesouro allows you to send test reminders to an invoice's counterpart, allowing you to verify the accuracy of your configuration.

To manually trigger an overdue reminder, call [`POST /receivables/{receivable_id}/send-test-reminder`](/finops/reference/openapi/receivables/post-receivables-id-send-test-reminder) and provide the `reminder_type` and `recipients` in the request body:

```sh lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/receivables/411dc6eb...6289b3/send-test-reminder' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "reminder_type": "overdue",
       "recipients": {
         "to": ["dana@example.com"],
         "cc": ["support@example.com", "sales@example.com"]
       }
     }
```

The successful response sends the reminder email to the counterpart and returns the `mail_ids` in the response.

## Disable overdue reminders

There are several ways to prevent overdue reminders from being sent.

### For a particular invoice

You can disable overdue reminders for a particular invoice. To do this, call `PATCH /receivables/{receivable_id}` and set the `overdue_reminder_id` to either an empty string (`""`) or `null`.

### For specific counterparts

By default, payment reminders are enabled for all counterparts of an organization.

If you want to disable reminders for a specific counterpart, call `PATCH /counterparts/{counterpart_id}` and set the `reminders_enabled` field to `false` as shown:

```sh lines theme={null}
curl -X PATCH 'https://api.sandbox.tesouro.com/v1/counterparts/6291de...3699' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "reminders_enabled": false
     }'
```

<Info>This disables both overdue reminders and payment reminders for the counterpart.</Info>

### For all counterparts of an organization

To disable reminders for all counterparts of a specific organization, call `PATCH /organizations/{organization_id}/settings` and set the value of the `reminder.enabled` field to `false`.

```sh lines theme={null}
curl -X PATCH 'https://api.sandbox.tesouro.com/identity/v1/organizations/692b50...09da8/settings' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
          "reminder": {
            "enabled": false
          }
      }'
```

<Info>
  This disables both overdue reminders and payment reminders for all counterparts of an
  organization.
</Info>

To enable reminders again, change the organization setting `reminder.enabled` back to `true`.
