> ## 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.

# Discounts

> Learn how to add discounts to outgoing invoices and quotes.

## Overview

A discount is a reduction in the price of a product or service that is offered by the seller. Discounts can be applied either to the final purchase, or to individual line items in an invoice or quote. Line item discounts are applied before overall discounts, and both are applied before tax is added in.

Tesouro also allows applying discounts up to the total product amount or invoice amount. This means that invoices and invoice line items can have 100% discounts or an effective price of `0`.

<Tip>
  To offer invoice discounts for early payments, use [payment terms](/finops/guides/common/payment-terms)
  instead.
</Tip>

## Discount types

Discounts can be specified as a percentage (such as 10.5%) or as a flat amount (such as \$12.50). Tesouro allows setting discounts at both the line item and invoice level.

For example, a *percentage* discount of 10.5% is specified as follows:

```json lines theme={null}
"discount": {
  "type": "percentage",
  "amount": 1050  // 10.5%
},
```

A *flat amount* discount of \$12.50 is specified as follows, where the `amount` is represented in [minor units](/finops/support/currencies#minor-units):

```json lines theme={null}
"discount": {
  "type": "amount",
  "amount": 1250  // $12.50
},
```

If the `discount` object is set to `null`, it means no discount.

## Add a discount

When creating a new invoice or quote or when editing an existing draft one, use the `discount` field on the document level or line item level to specify the discount:

<Tabs>
  <Tab title="Invoice-level discount">
    ```sh {10,11,12,13} 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",
           "currency": "USD",
           ...
           "discount": {
             "type": "amount",
             "amount": 1250
           }
         }'
    ```
  </Tab>

  <Tab title="Line item discount">
    ```sh expandable {15,16,17,18} 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",
           "currency": "USD",
           ...
           "line_items": [
             {
               "quantity": 1,
               "product_id": "8755c86a-d630-4920-b6fd-fd2917d87dfb",
               "discount": {
                 "type": "percentage",
                 "amount": 200
               }
             }
           ]
         }'
    ```
  </Tab>
</Tabs>

<Info>
  Line item discounts apply to line item as a whole rather than the price of a single product unit.
  In other words, a line item's subtotal is calculated as `(price * quantity) - discount`.
</Info>

## Update a discount

While the invoice or quote is still in the `draft` [status](/finops/guides/accounts-receivable/invoices/index#draft), you can update or remove the discounts if needed. To do this, call `PATCH /receivables/{receivable_id}` and provide the new `discount` object:

<Tabs>
  <Tab title="Invoices">
    ```sh lines theme={null}
    curl -X PATCH 'https://api.sandbox.tesouro.com/v1/receivables/411dc6eb...6289b3' \
         -H 'X-Finops-Version: 2025-06-23' \
         -H 'X-Organization-Id: ORGANIZATION_ID' \
         -H 'Authorization: Bearer ACCESS_TOKEN' \
         -H 'Content-Type: application/json' \
         -d '{
          "invoice": {
            "discount": {
              "type": "amount",
              "amount": 1500
            }
          }
        }'
    ```
  </Tab>

  <Tab title="Quotes">
    ```sh lines theme={null}
    curl -X PATCH 'https://api.sandbox.tesouro.com/v1/receivables/411dc6eb...6289b3' \
         -H 'X-Finops-Version: 2025-06-23' \
         -H 'X-Organization-Id: ORGANIZATION_ID' \
         -H 'Authorization: Bearer ACCESS_TOKEN' \
         -H 'Content-Type: application/json' \
         -d '{
          "quote": {
            "discount": {
              "type": "amount",
              "amount": 1500
            }
          }
        }'
    ```
  </Tab>
</Tabs>

Invoices and quotes in the `issued` status can no longer be edited, but there are other ways to amend their discount.

For invoices:

* To *increase* the discount, you can create a credit note for the difference amount.
* To *reduce* or *remove* the discount, you can issue a new invoice for the difference amount.

For quotes:

* To update or remove the discount, you can decline the existing quote and create a new one.

## Remove a discount

To remove a discount from a draft invoice, draft quote, or an individual line item, call `PATCH /receivables/{receivable_id}` and set the corresponding document-level `discount` or line item `discount` to `null`. For example:

```sh lines theme={null}
curl -X PATCH 'https://api.sandbox.tesouro.com/v1/receivables/411dc6eb...6289b3' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
      "invoice": {
        "discount": null
      }
    }'
```

Alternatively, you can set `discount.amount` to 0.

## See also

* [Deductions](/finops/guides/accounts-receivable/special-deductions) - discounts that are applied after tax
