# Orders to Be Matched (for Order Confirmations and Invoices)

Master data for validating associated orders. Workist can recognise the order reference on order confirmations and invoices and match the document against the provided order data. Workist prefills order confirmations without line items from the order data, and after every successful import it matches open order confirmations again. [Matching with order and quote data](/en/docs/channel-configuration/document-processing/matching.md) describes which values Workist compares and what happens on deviations.

## Column Description

> **Required:** Workist cannot use the record without this column. **Recommended:** significantly improves recognition. The import itself does not check columns: if a column is missing, the field stays empty.

### Header Level

| # | Field Name | Status | Description |
|---|----------|--------|--------------|
| 1 | `partition_id` | <span class="status-recommended">Recommended</span> | `client_id1` of the business partner (for order confirmations and invoices usually the supplier). Not mandatory, but very strongly recommended so that only this partner's orders can be selected. |
| 2 | `order_number` | <span class="status-required">Required</span> | Order number that the document refers to |
| 3 | `external_reference` | <span class="status-optional">Optional</span> | Second reference of the order, e.g. your business partner's order number. Workist searches `order_number` and `external_reference` alike. |
| 4 | `order_date` | <span class="status-optional">Optional</span> | Order date |
| 5 | `delivery_address` | <span class="status-optional">Optional</span> | Delivery address number (`address_id1` from the [delivery and invoice recipients](/en/docs/master-data/delivery-and-invoice-recipients.md)) |
| 6 | `receiver_number` | <span class="status-optional">Optional</span> | Number of the buyer or invoice recipient (`client_id1` from the channel's receiver list) |
| 7 | `order_total_price` | <span class="status-optional">Optional</span> | Total net value of the order |
| 8 | `iban` | <span class="status-optional">Optional</span> | IBAN to be paid to. Invoices only. |
| 9 | `swift` | <span class="status-optional">Optional</span> | BIC. Invoices only. |
| 10 | `account` | <span class="status-optional">Optional</span> | Payment reference. Invoices only. |
| 11 | `payment_terms_type` | <span class="status-optional">Optional</span> | Payment terms. Invoices only. |
| 12 | `payment_terms_discount` | <span class="status-optional">Optional</span> | Cash discount. Invoices only. |
| 13 | `payment_terms_due_days` | <span class="status-optional">Optional</span> | Payment due in days. Invoices only. |

### Line Item Level

Workist can also match order confirmations and invoices at line item level. For this purpose, the header fields must be repeated for each line item.

| # | Field Name | Status | Description |
|---|----------|--------|--------------|
| 1 | `position_number` | <span class="status-recommended">Recommended</span> | Line item number |
| 2 | `article_id1` | <span class="status-optional">Optional</span> | Article number. Leave empty for text items (items without a material). |
| 3 | `article_id2` | <span class="status-optional">Optional</span> | Alternative article number 2 |
| 4 | `article_id3` | <span class="status-optional">Optional</span> | Alternative article number 3 |
| 5 | `article_description` | <span class="status-optional">Optional</span> | Article description |
| 6 | `article_price` | <span class="status-optional">Optional</span> | Price, per price unit (`price_unit`) |
| 7 | `price_unit` | <span class="status-optional">Optional</span> | Price unit of the price, e.g. `1` or `100` (price per 100). Not to be confused with the quantity unit (`unit`, e.g. PCE or KG). |
| 8 | `quantity` | <span class="status-recommended">Recommended</span> | Quantity |
| 9 | `unit` | <span class="status-optional">Optional</span> | Unit |
| 10 | `total_price` | <span class="status-optional">Optional</span> | Total price of the line item |
| 11 | `delivery_date` | <span class="status-optional">Optional</span> | Delivery date of the line item. For order confirmations, Workist also compares it with the delivery date in the header. |
| 12 | `extra_data` | <span class="status-optional">Optional</span> | Additional information as a JSON object, e.g. `{"Brand": "Sample"}`. Workist stores it with the record and shows it in the data explorer. By default, Workist does not use it for recognition. |

Workist stores prices, quantities and amounts (`article_price`, `quantity`, `total_price`, `order_total_price`) with at most two decimal places; further digits are rounded. For prices with more decimal places, give the price per 10, 100 or 1000 pieces and set `price_unit` accordingly.

## Format

> Columns that are not needed can be omitted from the data export.

Example file name: `20240315_order_list.csv`. So that Workist always imports the newest file, use the file name pattern `%Y%m%d_order_list.csv` in the [import configuration](/en/docs/master-data/transformer-configuration.md).

```csv
partition_id;order_number;order_date;position_number;article_id1;quantity
K001;ORD-2024-0042;2024-03-15;1;ART001;10
K001;ORD-2024-0042;2024-03-15;2;ART002;5
K002;ORD-2024-0043;2024-03-16;1;ART003;2
```

The example uses `;` as delimiter. Set the delimiter in the [import configuration](/en/docs/master-data/transformer-configuration.md); without a setting, Workist expects a comma.

Write dates as `YYYY-MM-DD` or with the day first (`31.12.2024`), see [How Workist normalises values during the import](/en/docs/master-data.md#werte-vereinheitlichen).

Via the API you send the same columns as a CSV file or as JSON. Endpoint: [Swagger](https://api.workist.com/v1/swagger/#/Master%20Data/order_matching_imports_create), basics: [Using the Master Data API](/en/docs/api-documentation/master-data-api.md).
