# Cash discount

Cash discount speeds up payments. You offer a discount if the debtor pays before a given date.

### How it works

Add `cashdiscountrow` under the invoice `dataset`. It is an array, even if you only send one discount.

#### Fields

* `discountdate` (YYYY-MM-DD)
* `discountpercent` (0–100)
* `discountamount` (EUR)
* `discountfreetext` (optional)

### Example

```json
{
  "datastream": {
    "dataset": [
      {
        "jobtype": "0",
        "customertype": "1",
        "company": "Example Company",
        "address": "Example street 1",
        "postcode": "00100",
        "city": "Helsinki",
        "billdate": "2026-02-06",
        "paydate": "2026-02-20",
        "payrow": [
          { "desc": "Subscription", "count": "1", "amount": "1415.00", "taxpr": "24" }
        ],
        "cashdiscountrow": [
          {
            "discountdate": "2026-02-16",
            "discountpercent": "2",
            "discountamount": "28.30",
            "discountfreetext": "10 days -2%"
          }
        ]
      }
    ]
  }
}
```

{% hint style="info" %}
If you omit `discountfreetext`, the service can generate the text automatically.
{% endhint %}

{% hint style="warning" %}
The service validates `discountpercent` and `discountamount` against the invoice totals. Keep rounding consistent in your own calculations.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ropo.com/guides/basics/invoice/cash-discount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
