# Reference
URL: /docs/lan/reference

LAN message models and enums.

Field names are `snake_case`. Amounts are numbers in the order currency,
VAT-inclusive.

## Transaction

Returned by `POST_EFTPOS`, `POST_PAYMENT_START`, `POST_PAYMENT_CANCEL`,
`POST_EFTPOS_CANCEL` and `TRANSACTION_RESULT`.

| Field            | Type                          | Notes                                                                |
| ---------------- | ----------------------------- | -------------------------------------------------------------------- |
| `id`             | string                        | POS+ transaction id                                                  |
| `order_code`     | string                        |                                                                      |
| `payment_type`   | PaymentType                   |                                                                      |
| `payment_method` | PaymentMethod                 |                                                                      |
| `is_partial`     | bool                          |                                                                      |
| `partial_type`   | `AMOUNT` \| `PRODUCT` \| null |                                                                      |
| `total_amount`   | number                        |                                                                      |
| `total_paid`     | number                        |                                                                      |
| `amount_due`     | number                        |                                                                      |
| `status`         | TransactionStatus             |                                                                      |
| `action_status`  | bool                          |                                                                      |
| `source`         | string \| null                | filled by `TRANSACTION_RESULT`                                       |
| `invoice`        | object \| null                | `id, ettn, number, type, date, name, identity, tax_office, urn, url` |
| `payment`        | object \| null                | `rrn, card_number_masked, slip[]`                                    |
| `delivery`       | object \| null                | `type, status`                                                       |

## Order

Returned by `ORDER_RESULT` and `ORDER_PAYMENT`.

| Field          | Type                                                                      |
| -------------- | ------------------------------------------------------------------------- |
| `order_code`   | string                                                                    |
| `status`       | OrderStatus                                                               |
| `grand_total`  | number                                                                    |
| `total_amount` | number                                                                    |
| `total_paid`   | number                                                                    |
| `amount_due`   | number                                                                    |
| `results`      | `[{ completed: bool, error_message: string \| null, data: Transaction }]` |

## Order create

`data` of `ORDER_CREATE` and `ORDER_MULTI_PAYMENT`.

| Field                                                                        | Required      | Type                                                                          |
| ---------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------- |
| `order_code`                                                                 | yes           | string                                                                        |
| `order_date`                                                                 | yes           | string, `yyyy-MM-dd HH:mm`                                                    |
| `currency`                                                                   | yes           | `TRY`, `USD`, `EUR`, `GBP`                                                    |
| `delivery_type`                                                              | yes           | DeliveryType                                                                  |
| `discount_amount`                                                            | yes           | number                                                                        |
| `products`                                                                   | yes           | Product\[]                                                                    |
| `transactions`                                                               | multi-payment | `[{ payment_type, total_amount, payment_method? }]`                           |
| `note`, `user_id`, `serial_no`, `group_code`, `order_number`, `special_code` | no            | string                                                                        |
| `customer`                                                                   | no            | `{ code, name, phone, email, address, city, district, identity, tax_office }` |
| `installment`                                                                | no            | int                                                                           |
| `delivery_status`                                                            | no            | string                                                                        |
| `change_payment_status`, `can_try_again`                                     | no            | bool                                                                          |

**Product** (all required): `id` (int), `sku`, `title`, `unit` (`ADET`, `KG`,
`GR`, `LT`, `MT`, `KOLI`, `PAKET`, `PORSIYON`), `price`, `quantity`, `tax_rate`
(int), `vat_include` (bool), `product_type` (`PHYSICALLY`, `VIRTUAL`, …),
`discount_value`.

The reply is the order detail: `id`, `order_code`, `status`, `products`,
`transactions`, `sub_total`, `tax_amount`, `grand_total`, `total_paid`,
`amount_due`, …

## Enums

**PaymentType** — `POS`, `CASH`, `INSTALLMENT`, `PAYCELL`, `HEPSIPAY`,
`ISTANBULCARD`, `ONLINE`, `BANK_TRANSFER`, `GASTROPAY`, `CIO_CARD`, `IWALLET`,
`PAYE`, `MULTINET`, `METROPOL`, `FASTPAY`, `TICKET`, `EDENRED`, `SETCARD`,
`SODEXO`, `GETIRPAY`, `TOKENFLEX`, `YEMEKMATIK`, `ON_CREDIT`, `VIRTUAL_POS`,
`CUZDANPLUS`

**PaymentMethod** — `CC`, `NFC`, `QR`, `CASH`, `CHIP`, `SWIPE`, `NFC_R`,
`QR_R`, `QUICKCODE`, `MOBILE`, `LINK`, `NONE`, `PAYCELL_LINK`,
`PAYCELL_MERCHANT_PAGE`, `ONLINE`, `TRENDYOL`, `GETIR`, `YEMEKSEPETI`,
`MIGROSYEMEK`

**TransactionStatus** — `SUCCESS`, `CANCEL`, `FAIL`, `NONE`, `WAITING`,
`NOT_RESPONSE`

**OrderStatus** — `SUCCESS`, `CANCEL`, `WAITING`, `NOT_RESPONSE`

**DeliveryType** — `CASH_ORDER`, `PACKAGE_ORDER`, `TABLE_ORDER`, `TAKE_AWAY`,
`TAKE_CLOSE`

**EodType** — `POS`, `CASH`, `BANK_TRANSFER`, `ONLINE`, `OTHER`, `MULTINET`,
`SODEXO`, `SETCARD`, `TICKET`, `METROPOL`, `PAYE`, `TOKENFLEX`, `EDENRED`,
`CUZDANPLUS`, `IWALLET`