> For the complete documentation index, see [llms.txt](https://dev.ropo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ropo.com/guides/basics/invoice/cash-discount.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
