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

# LineCharge

LineCharge represents an amount added to the line, and will be applied before taxes.

## Schema ID

`https://gobl.org/draft-0/bill/line#/$defs/LineCharge`

## Properties

| Title      | Property   | Type                                      | Description                                                                                                                                                         |
| ---------- | ---------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Key        | `key`      | [cbc.Key](/draft-0/cbc/key)               | Key for grouping or identifying charges for tax purposes. A suggested list of keys is provided, but these are for reference only and may be extended by the issuer. |
| Code       | `code`     | [cbc.Code](/draft-0/cbc/code)             | Reference or ID for this charge defined by the issuer                                                                                                               |
| Reason     | `reason`   | string                                    | Text description as to why the charge was applied                                                                                                                   |
| Base       | `base`     | [num.Amount](/draft-0/num/amount)         | Base for percent calculations instead of the line's sum                                                                                                             |
| Percent    | `percent`  | [num.Percentage](/draft-0/num/percentage) | Percentage of base or parent line's sum                                                                                                                             |
| Quantity   | `quantity` | [num.Amount](/draft-0/num/amount)         | Quantity of units to apply the charge to when using the rate instead of the line's quantity.                                                                        |
| Unit       | `unit`     | [org.Unit](/draft-0/org/unit)             | Unit to associate with the quantity when using the rate.                                                                                                            |
| Rate       | `rate`     | [num.Amount](/draft-0/num/amount)         | Rate defines a price per unit to use instead of the percentage.                                                                                                     |
| Amount     | `amount`   | [num.Amount](/draft-0/num/amount)         | Fixed or resulting charge amount to apply (calculated if percent present).                                                                                          |
| Extensions | `ext`      | [tax.Extensions](/draft-0/tax/extensions) | Extension codes that apply to the charge                                                                                                                            |

## Key Values

| Value        | Description    |
| ------------ | -------------- |
| `stamp-duty` | Stamp Duty     |
| `outlay`     | Outlay         |
| `tax`        | Tax            |
| `customs`    | Customs        |
| `delivery`   | Delivery       |
| `packing`    | Packing        |
| `handling`   | Handling       |
| `insurance`  | Insurance      |
| `storage`    | Storage        |
| `admin`      | Administration |
| `cleaning`   | Cleaning       |

## Validation Rules

| Field      | Test                                                                                          | Validation Code / Message                                                  |
| ---------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `percent`  | <ul class="gobl-test"><li>Base != nil</li><li class="gobl-test-present">Present</li></ul>     | `GOBL-BILL-LINECHARGE-01`<br />Percent is required when base is set        |
| `quantity` | <ul class="gobl-test"><li>Base != nil \|\| Percent != nil</li><li>Empty</li></ul>             | `GOBL-BILL-LINECHARGE-02`<br />Quantity must be blank with base or percent |
| `rate`     | <ul class="gobl-test"><li>Base != nil \|\| Percent != nil</li><li>Empty</li></ul>             | `GOBL-BILL-LINECHARGE-03`<br />Rate must be blank with base or percent     |
| `unit`     | <ul class="gobl-test"><li>Quantity == nil</li><li>Empty</li></ul>                             | `GOBL-BILL-LINECHARGE-04`<br />Unit must be blank without quantity         |
| `rate`     | <ul class="gobl-test"><li>Quantity != nil</li><li class="gobl-test-present">Present</li></ul> | `GOBL-BILL-LINECHARGE-05`<br />Rate is required when quantity is set       |
