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

# Order

Order documents are used for the initial part of a order-to-invoice process where the buyer requests goods or services from the seller.

## Schema ID

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

## 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 the order. |
| Series | `series` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Identifies groups of orders 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 with a dash (`-`) for separation. |
| Code | `code` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Sequential identifier that uniquely identifies the order. May be left empty initially, but is **required** to **sign** the document. |
| Issue Date | `issue_date` | [cal.Date](https://docs.gobl.org/draft-0/cal/date.md) | When the order was created. |
| Issue Time | `issue_time` | [cal.Time](https://docs.gobl.org/draft-0/cal/time.md) | Optional time of day when the order 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 order 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 order totals. |
| 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. |
| Contracts | `contracts` | array of [org.DocumentRef](https://docs.gobl.org/draft-0/org/document_ref.md) | Contracts related to the document. |
| Preceding Details | `preceding` | array of [org.DocumentRef](https://docs.gobl.org/draft-0/org/document_ref.md) | Key information regarding previous order documents. |
| Identities | `identities` | array of [org.Identity](https://docs.gobl.org/draft-0/org/identity.md) | Additional codes, IDs, SKUs, or other regional or custom identifiers that may be used to identify the order. |
| Period | `period` | [cal.Period](https://docs.gobl.org/draft-0/cal/period.md) | Period of time in which the order is valid. |
| Tax | `tax` | [bill.Tax](https://docs.gobl.org/draft-0/bill/tax.md) | Special tax configuration for billing. |
| 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. |
| Buyer | `buyer` | [org.Party](https://docs.gobl.org/draft-0/org/party.md) | Party who is responsible for issuing payment, if not the same as the customer. |
| Seller | `seller` | [org.Party](https://docs.gobl.org/draft-0/org/party.md) | Party liable to pay taxes on the transaction, if not the same as the supplier. |
| Lines | `lines` | array of [bill.Line](https://docs.gobl.org/draft-0/bill/line.md) | List of lines representing each of the items to be ordered. |
| Discounts | `discounts` | array of [bill.Discount](https://docs.gobl.org/draft-0/bill/discount.md) | Discounts or allowances applied to the order totals. |
| Charges | `charges` | array of [bill.Charge](https://docs.gobl.org/draft-0/bill/charge.md) | Charges or surcharges applied to the order totals. |
| Payment Details | `payment` | [bill.PaymentDetails](https://docs.gobl.org/draft-0/bill/payment_details.md) | Information on when, how, and to whom a final invoice would be paid. |
| Delivery Details | `delivery` | [bill.DeliveryDetails](https://docs.gobl.org/draft-0/bill/delivery_details.md) | Specific details on delivery of the goods to copy to the final invoice. |
| Totals | `totals` | [bill.Totals](https://docs.gobl.org/draft-0/bill/totals.md) | Summary of all the order 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 order, 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 order. |
| 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 order. |
| 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 |
| - | - |
| `purchase` | A purchase order is a document that a buyer sends to a seller to request goods or services. |
| `sale` | A sales order is a document that a seller sends to a buyer to confirm the sale of goods or services. |
| `quote` | A quote is a document that a seller sends to a buyer to provide a price for goods or services. |

## Validation Rules

| Field | Test | Validation Code / Message |
| - | - | - |
| `type` | <ul><li>Present</li></ul> | `GOBL-BILL-ORDER-01` Type is required |
| `type` | <ul><li>One of \[purchase, sale, quote]</li></ul> | `GOBL-BILL-ORDER-02` Type is not valid |
| `issue_date` Calculated | <ul><li>Present</li></ul> | `GOBL-BILL-ORDER-03` Issue date is required |
| `currency` Calculated | <ul><li>Present</li></ul> | `GOBL-BILL-ORDER-04` Currency is required |
| `supplier` | <ul><li>Present</li></ul> | `GOBL-BILL-ORDER-05` Supplier is required |
| `lines` | <ul><li>Present</li></ul> | `GOBL-BILL-ORDER-06` Lines are required |


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