---
title: tm.order
slug: db/tmorder
createdAt: 2023-12-14T14:12:38.508Z
---

An order is a sales transaction and contains tickets bought by a contact.

## Fields

| FIELD                     | TYPE        | DESCRIPTION                                                                                                                                                                                   |
| ------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                        | `int`       | ID                                                                                                                                                                                            |
| createdts                 | `timestamp` | Created timestamp                                                                                                                                                                             |
| lastupdatets              | `timestamp` | Last update timestamp                                                                                                                                                                         |
| contactid                 | `int`       | DEPRECATED, use customerid<br />**References:&#x20;**[tm.contact](docId\:uFIX35lrtF5E4t_ERzoMr)                                                                                               |
| customerid                | `int`       | A link to the contact that is the customer for this order.                                                                                                                                    |
| status                    | `int`       | The status of the order: unconfirmed (21001), confirmed (21002), archived (21003) or<br />draft (21004)                                                                                       |
| saleschannelid            | `int`       | The saleschannel this order was placed in<br />**References:** [tm.saleschannel](docId\:pUqmzWY-Lt3Yr5oUGFnEO)                                                                                |
| amountpaid                | `decimal`   | The total amount that was paid for this order                                                                                                                                                 |
| totalamount               | `decimal`   | The total amount for the order                                                                                                                                                                |
| code                      | `int`       | Generated code that is random and unique for each order. An id can be enumerated, this code not.                                                                                              |
| paymentscenarioid         | `int`       | The selected payment scenario for the order<br />**References:** [tm.paymentscenario](docId:7dbVCtOqsvqFzHSuCZp-m)                                                                            |
| deliveryscenarioid        | `int`       | The selected delivery scenario for the order<br />**References:** [tm.deliveryscenario](docId:9q6Uc00PW_DLU_MZnibXV)                                                                          |
| paymentstatus             | `int`       | Payment status for the order. Possible values 'Fully paid' (1), 'Not fully paid' (0), 'Overpaid' (2)                                                                                          |
| deliverystatus            | `int`       | Delivery status for the order. Links to systemtype category 26xx. Possible values Not delivered (2601) or Delivered (2602)<br />**References:** [tm.systemtype](docId\:YVf7OQ_iruf6NpUOHG2XQ) |
| delivery\_addressee       | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_street1         | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_street2         | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_street3         | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_street4         | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_city            | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_zip             | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| delivery\_countrycode     | `string`    | If order is delivered by mail (post) this contains the delivery address.                                                                                                                      |
| rappelts                  | `timestamp` | Timestamp at which order will be overdue                                                                                                                                                      |
| expiryts                  | `timestamp` | Timestamp at which order will be expired                                                                                                                                                      |
| deferredpaymentproperties | `text`      | Information about the deferred payment                                                                                                                                                        |
| nbroftickets              | `int`       | Number of tickets in the order                                                                                                                                                                |
| tmuserid                  | `int`       | TM user who created this order                                                                                                                                                                |
| referral                  | `string`    | Referral                                                                                                                                                                                      |

This table can also contain one or more customfields. Each customfield starts with `c_`
