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

# Payment

A Payment is used to link an invoice or invoices with a payment transaction.

## Schema ID

`https://gobl.org/draft-0/bill/payment`

## Properties

| Title             | Property         | Type                                                              | Description                                                                                                                                                                                                                                                                                                                                            |
| ----------------- | ---------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Tax Regime        | `$regime`        | [tax.RegimeCode](/draft-0/tax/regime_code)                        | Country code that identifies the tax regime applicable to the document. It determines which country-specific tax rules, normalizations, and validations are applied. It may be determined automatically via normalization of a supplier or issuer tax identity country code.                                                                           |
| Addons            | `$addons`        | [tax.AddonList](/draft-0/tax/addon_list)                          | Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.                                                                                                                                                                                                             |
| Tags              | `$tags`          | array of [cbc.Key](/draft-0/cbc/key)                              | Tags are used to help identify specific tax scenarios or requirements that may apply changes to the contents of the document or imply a specific meaning. Converters may use tags to help identify specific situations that do not have a specific extension, for example; self-billed or partial invoices may be identified by their respective tags. |
| UUID              | `uuid`           | string                                                            | Universally Unique Identifier.                                                                                                                                                                                                                                                                                                                         |
| Type              | `type`           | [cbc.Key](/draft-0/cbc/key)                                       | Type of payment document being issued.                                                                                                                                                                                                                                                                                                                 |
| Series            | `series`         | [cbc.Code](/draft-0/cbc/code)                                     | Series is used to identify groups of payments by date, business area, project, type, customer, a combination of any, or other company specific data. If the output format does not support the series as a separate field, it will be prepended to the code for presentation with a dash (`-`) for separation.                                         |
| Code              | `code`           | [cbc.Code](/draft-0/cbc/code)                                     | Code is a sequential identifier that uniquely identifies the payment. The code can be left empty initially, but is **required** to **sign** the document.                                                                                                                                                                                              |
| Issue Date        | `issue_date`     | [cal.Date](/draft-0/cal/date)                                     | When the payment was issued.                                                                                                                                                                                                                                                                                                                           |
| Issue Time        | `issue_time`     | [cal.Time](/draft-0/cal/time)                                     | IssueTime is an optional field that may be useful to indicate the time of day when the payment was issued.                                                                                                                                                                                                                                             |
| Value Date        | `value_date`     | [cal.Date](/draft-0/cal/date)                                     | When the taxes of this payment become accountable, if none set, the issue date is assumed.                                                                                                                                                                                                                                                             |
| Currency          | `currency`       | [currency.Code](/draft-0/currency/code)                           | Currency for all payment totals.                                                                                                                                                                                                                                                                                                                       |
| Exchange Rates    | `exchange_rates` | array of [currency.ExchangeRate](/draft-0/currency/exchange_rate) | Exchange rates to be used when converting the payment's monetary values into other currencies.                                                                                                                                                                                                                                                         |
| Extensions        | `ext`            | [tax.Extensions](/draft-0/tax/extensions)                         | Extensions for additional codes that may be required.                                                                                                                                                                                                                                                                                                  |
| Preceding Details | `preceding`      | array of [org.DocumentRef](/draft-0/org/document_ref)             | Key information regarding previous versions of this document.                                                                                                                                                                                                                                                                                          |
| Supplier          | `supplier`       | [org.Party](/draft-0/org/party)                                   | The taxable entity who is responsible for supplying goods or services.                                                                                                                                                                                                                                                                                 |
| Customer          | `customer`       | [org.Party](/draft-0/org/party)                                   | Legal entity that receives the goods or services.                                                                                                                                                                                                                                                                                                      |
| Payee             | `payee`          | [org.Party](/draft-0/org/party)                                   | Legal entity that receives the payment if not the supplier.                                                                                                                                                                                                                                                                                            |
| Lines             | `lines`          | array of [bill.PaymentLine](/draft-0/bill/payment_line)           | List of documents that are being paid for.                                                                                                                                                                                                                                                                                                             |
| Methods           | `methods`        | array of [pay.Record](/draft-0/pay/record)                        | Methods describes how the payment was settled. At least one method is required; multiple may be present when the payment was split across means (for example, partly card + partly cash).                                                                                                                                                              |
| Ordering          | `ordering`       | [bill.Ordering](/draft-0/bill/ordering)                           | Ordering allows for additional information about the ordering process including references to other documents and alternative parties involved in the order-to-delivery process.                                                                                                                                                                       |
| Total             | `total`          | [num.Amount](/draft-0/num/amount)                                 | Total amount to be paid in this payment, either positive or negative according to the line types and totals. Calculated automatically.                                                                                                                                                                                                                 |
| Notes             | `notes`          | array of [org.Note](/draft-0/org/note)                            | Unstructured information that is relevant to the payment, such as correction or additional legal details.                                                                                                                                                                                                                                              |
| Complements       | `complements`    | array of [schema.Object](/draft-0/schema/object)                  | Additional complementary objects that add relevant information to the payment.                                                                                                                                                                                                                                                                         |
| Meta              | `meta`           | [cbc.Meta](/draft-0/cbc/meta)                                     | Additional semi-structured data that doesn't fit into the body of the invoice.                                                                                                                                                                                                                                                                         |

## Type Values

| Value     | Description                                                                                                                                                                                                                                                                                           |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `request` | A payment request sent from the supplier to a customer indicating that they are requesting a transfer of funds from the customer directly or a payer. This is used to request payment for specific documents and invoices.                                                                            |
| `advice`  | A remittance advice sent from the customer to the supplier reflecting that payment for the referenced documents has been made.                                                                                                                                                                        |
| `receipt` | A payment receipt sent from the supplier to a customer indicating that they have received a transfer of funds from the customer directly or a payer. This is the default payment type and may be required by some tax regimes in order to communicate the payment of specific documents and invoices. |

## Validation Rules

| Field                                                                     | Test                                                                   | Validation Code / Message                                           |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <small>Payment</small>                                                    | <ul class="gobl-test"><li>Methods sum</li></ul>                        | `GOBL-BILL-PAYMENT-08`<br />Methods sum must match total            |
| `type`<br /><small class="gobl-field-calculated">Calculated</small>       | <ul class="gobl-test"><li>Present</li></ul>                            | `GOBL-BILL-PAYMENT-01`<br />Payment type is required                |
| `type`<br /><small class="gobl-field-calculated">Calculated</small>       | <ul class="gobl-test"><li>One of \[request, advice, receipt]</li></ul> | `GOBL-BILL-PAYMENT-02`<br />Payment type is not valid               |
| `methods`                                                                 | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>  | `GOBL-BILL-PAYMENT-03`<br />At least one payment method is required |
| `methods[*].key`                                                          | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>  | `GOBL-BILL-PAYMENT-09`<br />Payment method key is required          |
| `issue_date`<br /><small class="gobl-field-calculated">Calculated</small> | <ul class="gobl-test"><li>Present</li></ul>                            | `GOBL-BILL-PAYMENT-04`<br />Payment issue date is required          |
| `currency`<br /><small class="gobl-field-calculated">Calculated</small>   | <ul class="gobl-test"><li>Present</li></ul>                            | `GOBL-BILL-PAYMENT-05`<br />Payment currency is required            |
| `supplier`                                                                | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>  | `GOBL-BILL-PAYMENT-06`<br />Payment supplier is required            |
| `lines`                                                                   | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>  | `GOBL-BILL-PAYMENT-07`<br />Payment lines are required              |
