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

# How the terms hierarchy works

Most terms hold several rates, and a sale often fits more than one of them. Since the branches sit top to bottom in the builder, it can be incorrectly assumed that the top one wins, but order plays no part in the calculation. Qlero pays the most specific rate that matches the sale, decided in two steps:

1. **The closest territory match wins first.** A rate under a territory selection that covers fewer territories beats any rate under a broader one, no matter how detailed the branches are.
2. **Then the deepest condition wins.** Among rates with the same territory match, the winner is the one whose last condition sits furthest down the level list: **Store** beats **Source**, which beats **Price Category**, **Format**, and **Sale Type**, which beat a rate sitting directly under the territory.

## A base rate and one override

Say a deal pays 16% of Net Receipts on everything, except streams, which pay 20%. As a term, that is a base rate plus one override:

<img src="https://mintcdn.com/qlero/hBIPUWJRkQWqgOj3/images/guides/gud-1505/terms-hierarchy-worldwide.png?fit=max&auto=format&n=hBIPUWJRkQWqgOj3&q=85&s=de5abb83a2603e86fcaf795a3da1ec00" alt="Worldwide base rate with a streaming override" width="966" height="278" data-path="images/guides/gud-1505/terms-hierarchy-worldwide.png" />

| The sale         | It matches  | It pays                          |
| ---------------- | ----------- | -------------------------------- |
| Audio stream     | 16% and 20% | 20%, the more specific rate      |
| CD, download, LP | only 16%    | 16%, the rate with no conditions |

The 16% rate is the safety net: anything that fits no override falls back to it. And the order is irrelevant: put the **Stream** branch above or below the base rate and every sale pays exactly the same.

## Territory overrides

Now the deal changes: in Germany everything pays 18%, except streams, which pay 22% there. That is a second territory rule with its own override inside:

<img src="https://mintcdn.com/qlero/hBIPUWJRkQWqgOj3/images/guides/gud-1505/terms-hierarchy-germany-override.png?fit=max&auto=format&n=hBIPUWJRkQWqgOj3&q=85&s=0be3fb3a5290162a1e31bfb924b031ec" alt="Germany base rate with a streaming override" width="966" height="294" data-path="images/guides/gud-1505/terms-hierarchy-germany-override.png" />

| The sale            | It matches             | It pays                              |
| ------------------- | ---------------------- | ------------------------------------ |
| Stream in Japan     | 16% and 20%            | 20%, as before                       |
| Download in Germany | 16% and 18%            | 18%, the closer territory match      |
| Stream in Germany   | 16%, 20%, 18%, and 22% | 22%, deepest in the closer territory |

The German stream is the one worth staring at. It fits the Worldwide streaming rate too, but territory is decided first, so only the two German rates compete and the deeper one wins. That also means a German override hides the Worldwide ones: without the 22% branch, streams in Germany would pay the plain 18%, not 20%. If a territory branch should keep a Worldwide override, repeat that override under the territory.

## Overrides inside overrides

Overrides can keep narrowing, level by level: sale type, then format, price category, source, and store. Say streams pay 20%, but streams reported by YouTube pay 12%. That is an override on the streaming override:

<img src="https://mintcdn.com/qlero/hBIPUWJRkQWqgOj3/images/guides/gud-1505/terms-hierarchy-source-override.png?fit=max&auto=format&n=hBIPUWJRkQWqgOj3&q=85&s=433ef9013119f21597941ad938e207ca" alt="Worldwide streaming rate with a nested YouTube override" width="966" height="448" data-path="images/guides/gud-1505/terms-hierarchy-source-override.png" />

| The sale                     | It matches        | It pays                              |
| ---------------------------- | ----------------- | ------------------------------------ |
| Stream on Spotify in Japan   | 16% and 20%       | 20%, as before                       |
| Stream on YouTube in Japan   | 16%, 20%, and 12% | 12%, the deepest condition           |
| Stream on YouTube in Germany | all five rates    | 22%, deepest in the closer territory |

The last row is the earlier lesson again: the YouTube override lives under **Worldwide**, so in Germany it loses to the German branch along with everything else there.

## When no rate matches

A sale that matches no branch at all is not priced: it goes to suspense with a reason telling you which level failed, such as **Price category not matched in sales term**, so you can extend the term and recalculate. The safety-net rate from the first example is the way to prevent that.

Suspense is also why a 0% rate is more useful than no rate. To deliberately pay nothing on some revenue, give it a matching branch with a rate of 0: the sale is priced at zero and the period stays clean, instead of piling up in suspense.

A deduction term that matches nothing is harmless by contrast: the sale gets no deduction.

## Next steps

* Build and attach the terms themselves in [Creating and linking contract terms](/labels/agreements/contract-terms).
