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

# PaymentLine

PaymentLine defines the details of a line item in a payment document.

## Schema ID

`https://gobl.org/draft-0/bill/payment#/$defs/PaymentLine`

## Properties

| Title       | Property      | Type                                         | Description                                                                                                                                                                           |
| ----------- | ------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UUID        | `uuid`        | string                                       | Universally Unique Identifier.                                                                                                                                                        |
| Index       | `i`           | integer                                      | Line number within the parent document (automatically calculated)                                                                                                                     |
| Refund      | `refund`      | boolean                                      | Indicates whether this payment is a refund of a previous payment, effectively reversing the flow of funds between the supplier and customer or their representatives.                 |
| Document    | `document`    | [org.DocumentRef](/draft-0/org/document_ref) | Reference to the document being paid                                                                                                                                                  |
| Installment | `installment` | integer                                      | When making multiple payments for a single document, this specifies the installment number for this payment line.                                                                     |
| Description | `description` | string                                       | Additional human readable description of the payment line which may be useful for explaining the purpose or special conditions. Notes should be used for more formal comments.        |
| Payable     | `payable`     | [num.Amount](/draft-0/num/amount)            | Payable reflects the amount of the document that is payable. This will be calculated from the embedded document's amount automatically and converted to the currency of the document. |
| Advances    | `advances`    | [num.Amount](/draft-0/num/amount)            | Amount already paid in previous installments, which may be required by some tax regimes or specific use cases.                                                                        |
| Amount      | `amount`      | [num.Amount](/draft-0/num/amount)            | Amount of the total payment allocated to the referenced document.                                                                                                                     |
| Due         | `due`         | [num.Amount](/draft-0/num/amount)            | Due reflects how much still needs to be paid                                                                                                                                          |
| Tax         | `tax`         | [tax.Total](/draft-0/tax/total)              | Tax contains a breakdown of the taxes that will be applied to this payment line after taking into account currency conversion and the relative amounts.                               |
| Notes       | `notes`       | array of [org.Note](/draft-0/org/note)       | Additional notes specific to this line item for clarification purposes                                                                                                                |

## Validation Rules

| Field                      | Test                                                               | Validation Code / Message                                                    |
| -------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| <small>PaymentLine</small> | <ul class="gobl-test"><li>Advances within payable</li></ul>        | `GOBL-BILL-PAYMENTLINE-11`<br />Advances must not exceed payable             |
| <small>PaymentLine</small> | <ul class="gobl-test"><li>Amount within limit</li></ul>            | `GOBL-BILL-PAYMENTLINE-12`<br />Amount must not exceed payable less advances |
| `installment`              | <ul class="gobl-test"><li>At least 1</li><li>At most 999</li></ul> | `GOBL-BILL-PAYMENTLINE-01`<br />Installment must be between 1 and 999        |
| `payable`                  | <ul class="gobl-test"><li>Min 0</li></ul>                          | `GOBL-BILL-PAYMENTLINE-02`<br />Payable must be positive                     |
| `advances`                 | <ul class="gobl-test"><li>Min 0</li></ul>                          | `GOBL-BILL-PAYMENTLINE-03`<br />Advances must be zero or positive            |
| `amount`                   | <ul class="gobl-test"><li>Min 0</li></ul>                          | `GOBL-BILL-PAYMENTLINE-04`<br />Amount must be positive                      |
| `due`                      | <ul class="gobl-test"><li>Min 0</li></ul>                          | `GOBL-BILL-PAYMENTLINE-05`<br />Due must be zero or positive                 |
