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

# Invoice

Invoice represents a payment claim for goods or services supplied under conditions agreed between the supplier and the customer.

## Schema ID

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

## Properties

| Title | Property | Type | Description |
| - | - | - | - |
| Tax Regime | `$regime` | [tax.RegimeCode](https://docs.gobl.org/draft-0/tax/regime_code.md) | 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](https://docs.gobl.org/draft-0/tax/addon_list.md) | Keys identifying the tax addons that apply special normalization, scenarios, and validation rules to the document. |
| Tags | `$tags` | array of [cbc.Key](https://docs.gobl.org/draft-0/cbc/key.md) | Keys that identify specific tax scenarios or requirements that may change the contents of the document or imply a specific meaning. Converters may use tags to identify situations that do not have a specific extension; for example, self-billed or partial invoices are identified by their respective tags. |
| UUID | `uuid` | string | Universally Unique Identifier. |
| Type | `type` | [cbc.Key](https://docs.gobl.org/draft-0/cbc/key.md) | Type of invoice document. May be restricted by local tax regime requirements. |
| Series | `series` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Identifies groups of invoices by date, business area, project, type of document, customer type, 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 with a dash (`-`) for separation. |
| Code | `code` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Sequential identifier that uniquely identifies the invoice. May be left empty initially, but is **required** to **sign** the invoice. |
| Issue Date | `issue_date` | [cal.Date](https://docs.gobl.org/draft-0/cal/date.md) | Date when the invoice was created and issued. Today's date is used if none is set. There are often legal restrictions on how far back or in the future an invoice can be issued. |
| Issue Time | `issue_time` | [cal.Time](https://docs.gobl.org/draft-0/cal/time.md) | Optional time of day when the invoice was issued. Some regions and formats may require this field; otherwise it can be left nil. |
| Operation Date | `op_date` | [cal.Date](https://docs.gobl.org/draft-0/cal/date.md) | Date when the operation defined by the invoice became effective. |
| Value Date | `value_date` | [cal.Date](https://docs.gobl.org/draft-0/cal/date.md) | When the taxes of the document become accountable. Defaults to the issue date. |
| Currency | `currency` | [currency.Code](https://docs.gobl.org/draft-0/currency/code.md) | Currency for all invoice amounts and totals, unless explicitly stated otherwise. |
| Exchange Rates | `exchange_rates` | array of [currency.ExchangeRate](https://docs.gobl.org/draft-0/currency/exchange_rate.md) | Exchange rates to be used when converting the document's monetary values into other currencies. |
| Preceding Details | `preceding` | array of [org.DocumentRef](https://docs.gobl.org/draft-0/org/document_ref.md) | Document references for previous invoices that this document replaces or extends. |
| Tax | `tax` | [bill.Tax](https://docs.gobl.org/draft-0/bill/tax.md) | Special billing tax configuration options. |
| Supplier | `supplier` | [org.Party](https://docs.gobl.org/draft-0/org/party.md) | The entity supplying the goods or services and usually responsible for paying taxes. |
| Customer | `customer` | [org.Party](https://docs.gobl.org/draft-0/org/party.md) | Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices. |
| Lines | `lines` | array of [bill.Line](https://docs.gobl.org/draft-0/bill/line.md) | List of invoice lines representing each of the items sold to the customer. |
| Discounts | `discounts` | array of [bill.Discount](https://docs.gobl.org/draft-0/bill/discount.md) | Discounts or allowances applied to the complete invoice |
| Charges | `charges` | array of [bill.Charge](https://docs.gobl.org/draft-0/bill/charge.md) | Charges or surcharges applied to the complete invoice |
| Ordering Details | `ordering` | [bill.Ordering](https://docs.gobl.org/draft-0/bill/ordering.md) | Ordering details including document references and buyer or seller parties. |
| Payment Details | `payment` | [bill.PaymentDetails](https://docs.gobl.org/draft-0/bill/payment_details.md) | Information on when, how, and to whom the invoice should be paid. |
| Delivery Details | `delivery` | [bill.DeliveryDetails](https://docs.gobl.org/draft-0/bill/delivery_details.md) | Specific details on delivery of the goods referenced in the invoice. |
| Totals | `totals` | [bill.Totals](https://docs.gobl.org/draft-0/bill/totals.md) | Summary of all the invoice totals, including taxes (calculated). |
| Notes | `notes` | array of [org.Note](https://docs.gobl.org/draft-0/org/note.md) | Unstructured information that is relevant to the invoice, such as correction or additional legal details. |
| Complements | `complements` | array of [schema.Object](https://docs.gobl.org/draft-0/schema/object.md) | Additional complementary objects that add relevant information to the invoice. |
| Meta | `meta` | [cbc.Meta](https://docs.gobl.org/draft-0/cbc/meta.md) | Additional semi-structured data that doesn't fit into the body of the invoice. |
| Attachments | `attachments` | array of [org.Attachment](https://docs.gobl.org/draft-0/org/attachment.md) | Supporting documents that are not included in the main document. Do not use for alternative versions of the PDF; use "links" inside the envelope headers instead. |

## Type Values

| Value | Description |
| - | - |
| `standard` | A regular commercial invoice document between a supplier and customer. |
| `proforma` | For a client's validation before sending a final invoice. |
| `corrective` | Corrected invoice that completely *replaces* the preceding document. |
| `credit-note` | Reflects a refund either partial or complete of the preceding document. A credit note effectively *extends* the previous document. |
| `debit-note` | An additional set of charges to be added to the preceding document. |
| `other` | Any other type of invoice that does not fit into the standard categories and implies that any scenarios defined in tax regimes or addons will not be applied. This is useful for being able to create invoices with custom types in extensions, but is not recommended for general use. |

## Validation Rules

| Field | Test | Validation Code / Message |
| - | - | - |
| `type` Calculated | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-01` Invoice type is required |
| `type` Calculated | <ul><li>One of \[standard, proforma, corrective, credit-note, debit-note, other]</li></ul> | `GOBL-BILL-INVOICE-02` Invoice type is not valid |
| `issue_date` Calculated | <ul><li>Not zero</li></ul> | `GOBL-BILL-INVOICE-03` Invoice issue date is required |
| `currency` Calculated | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-04` Invoice currency is required |
| `supplier` | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-05` Invoice supplier is required |
| `supplier.name` | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-06` Invoice supplier name is required |
| `value_date` | <ul><li>Has tax point</li><li>Empty</li></ul> | `GOBL-BILL-INVOICE-11` Value date cannot be set when tax point is set |
| `customer.name` | <ul><li>Has tax ID code</li><li>Present</li></ul> | `GOBL-BILL-INVOICE-07` Invoice customer name required when tax ID is set |
| `lines[*].item.price` | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-08` Invoice line item price is required |
| `totals` Calculated | <ul><li>Present</li></ul> | `GOBL-BILL-INVOICE-09` Invoice totals are required |
| `lines` | <ul><li>No discounts or charges</li><li>Present</li></ul> | `GOBL-BILL-INVOICE-10` Invoice lines are required without discounts or charges |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.