Get a list of orders

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/orders

Example

Request

 1use Ticketmatic\Endpoints\Orders;
 2
 3$result = Orders::getlist($client, array(
 4    "filter" => "select id from tm.order where totalamount > 100",
 5    "includearchived" => false,
 6    "lastupdatesince" => "2014-09-26 15:24:36",
 7    "limit" => 100,
 8    "offset" => 100,
 9    "orderby" => "createdts",
10    "orderby_asc" => true,
11    "output" => "withlookup",
12    "searchterm" => "Live",
13    "simplefilter" => array(
14        "saleschannelid" => 123,
15    ),
16));
17
18// The parameters array is optional, it can be omitted when empty.
19$result = Orders::getlist($client);

Response

  1object(Ticketmatic\Endpoints\OrdersList) (1) {
  2  ["data"]=>
  3  array(1) {
  4    [0]=>
  5    object(\Ticketmatic\Model\Order) (33) {
  6      ["orderid"]=>
  7      int(0)
  8      ["amountpaid"]=>
  9      float(15.000000)
 10      ["calculate_ordercosts"]=>
 11      bool(true)
 12      ["code"]=>
 13      string(12) "864056970700"
 14      ["customerid"]=>
 15      int(0)
 16      ["deferredpaymentproperties"]=>
 17      array(4) {
 18        ["bankAccount"]=>
 19        string(16) "BE54719400092697"
 20        ["bankBic"]=>
 21        string(8) "FTSBBE22"
 22        ["bankName"]=>
 23        string(25) "Stichting Mollie Payments"
 24        ["transferReference"]=>
 25        string(20) "+++695/7317/77752+++"
 26      }
 27      ["deliveryaddress"]=>
 28      object(\Ticketmatic\Model\Address) (2) {
 29        ["city"]=>
 30        string(6) "Leuven"
 31        ["street1"]=>
 32        string(11) "Main street"
 33      }
 34      ["deliveryscenarioid"]=>
 35      int(0)
 36      ["deliverystatus"]=>
 37      int(0)
 38      ["expiryhandled"]=>
 39      bool(false)
 40      ["expiryts"]=>
 41      object(\DateTime) (3) {
 42        ["date"]=>
 43        string(26) "2014-09-26 15:24:36.000000"
 44        ["timezone_type"]=>
 45        int(3)
 46        ["timezone"]=>
 47        string(3) "UTC"
 48      }
 49      ["firstname"]=>
 50      string(4) "John"
 51      ["hasopenpaymentrequest"]=>
 52      bool(true)
 53      ["isauthenticatedcustomer"]=>
 54      bool(false)
 55      ["lastname"]=>
 56      string(3) "Doe"
 57      ["lookup"]=>
 58      array(1) {
 59        ["events"]=>
 60          array(0) {
 61          }
 62      }
 63      ["nbroftickets"]=>
 64      int(0)
 65      ["ordercosts"]=>
 66      array(2) {
 67        [0]=>
 68        object(\Ticketmatic\Model\Ordercost) (3) {
 69          ["orderid"]=>
 70          int(0)
 71          ["amount"]=>
 72          float(5.500000)
 73          ["servicechargedefinitionid"]=>
 74          int(0)
 75        }
 76        [1]=>
 77        object(\Ticketmatic\Model\Ordercost) (3) {
 78          ["orderid"]=>
 79          int(0)
 80          ["amount"]=>
 81          float(2.000000)
 82          ["servicechargedefinitionid"]=>
 83          int(0)
 84        }
 85      }
 86      ["payments"]=>
 87      array(1) {
 88        [0]=>
 89        object(\Ticketmatic\Model\Payment) (7) {
 90          ["id"]=>
 91          int(0)
 92          ["orderid"]=>
 93          int(0)
 94          ["amount"]=>
 95          float(50.000000)
 96          ["paidts"]=>
 97          object(\DateTime) (3) {
 98            ["date"]=>
 99            string(26) "2015-04-07 07:00:00.000000"
100            ["timezone_type"]=>
101            int(3)
102            ["timezone"]=>
103            string(3) "UTC"
104          }
105          ["paymentmethodid"]=>
106          int(0)
107          ["properties"]=>
108          NULL
109          ["refundpaymentid"]=>
110          NULL
111        }
112      }
113      ["paymentscenarioid"]=>
114      int(0)
115      ["paymentstatus"]=>
116      int(0)
117      ["products"]=>
118      array(1) {
119        [0]=>
120        object(\Ticketmatic\Model\OrderProduct) (8) {
121          ["id"]=>
122          int(0)
123          ["orderid"]=>
124          int(0)
125          ["code"]=>
126          string(12) "123412341234"
127          ["contactid"]=>
128          NULL
129          ["price"]=>
130          float(15.000000)
131          ["productid"]=>
132          int(0)
133          ["properties"]=>
134          NULL
135        }
136      }
137      ["promocodes"]=>
138      array(2) {
139        [0]=>
140        string(9) "PROMO2015"
141        [1]=>
142        string(9) "COOLPROMO"
143      }
144      ["queuetokens"]=>
145      array(2) {
146        [0]=>
147        int(0)
148        [1]=>
149        int(0)
150      }
151      ["rappelhandled"]=>
152      bool(false)
153      ["rappelts"]=>
154      object(\DateTime) (3) {
155        ["date"]=>
156        string(26) "2014-09-26 15:24:36.000000"
157        ["timezone_type"]=>
158        int(3)
159        ["timezone"]=>
160        string(3) "UTC"
161      }
162      ["saleschannelid"]=>
163      int(0)
164      ["status"]=>
165      int(0)
166      ["tickets"]=>
167      array(2) {
168        [0]=>
169        object(\Ticketmatic\Model\OrderTicket) (8) {
170          ["id"]=>
171          int(0)
172          ["orderid"]=>
173          int(0)
174          ["price"]=>
175          float(15.000000)
176          ["servicecharge"]=>
177          float(1.000000)
178          ["ticketholderid"]=>
179          NULL
180          ["ticketname"]=>
181          NULL
182          ["tickettypeid"]=>
183          int(0)
184          ["tickettypepriceid"]=>
185          int(0)
186        }
187        [1]=>
188        object(\Ticketmatic\Model\OrderTicket) (8) {
189          ["id"]=>
190          int(0)
191          ["orderid"]=>
192          int(0)
193          ["price"]=>
194          float(15.000000)
195          ["servicecharge"]=>
196          float(1.000000)
197          ["ticketholderid"]=>
198          NULL
199          ["ticketname"]=>
200          NULL
201          ["tickettypeid"]=>
202          int(0)
203          ["tickettypepriceid"]=>
204          int(0)
205        }
206      }
207      ["totalamount"]=>
208      float(25.500000)
209      ["webskinid"]=>
210      int(0)
211      ["createdts"]=>
212      object(\DateTime) (3) {
213        ["date"]=>
214        string(26) "2014-09-26 15:24:36.000000"
215        ["timezone_type"]=>
216        int(3)
217        ["timezone"]=>
218        string(3) "UTC"
219      }
220      ["lastupdatets"]=>
221      object(\DateTime) (3) {
222        ["date"]=>
223        string(26) "2014-09-26 15:24:36.000000"
224        ["timezone_type"]=>
225        int(3)
226        ["timezone"]=>
227        string(3) "UTC"
228      }
229    }
230  }
231}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/orders"
 4)
 5
 6result, err := orders.Getlist(client, &ticketmatic.OrderQuery{
 7    Filter: "select id from tm.order where totalamount > 100",
 8    Includearchived: false,
 9    Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10    Limit: 100,
11    Offset: 100,
12    Orderby: "createdts",
13    OrderbyAsc: true,
14    Output: "withlookup",
15    Searchterm: "Live",
16    Simplefilter: &ticketmatic.OrderFilter{
17        Saleschannelid: 123,
18    },
19})
20
21// The query object is optional, it can be omitted when empty.
22result, err := orders.Getlist(client, nil)

Response

  1result := orders.&List{
  2    Data: []*ticketmatic.Order{
  3        &ticketmatic.Order{
  4            Orderid: 1269434,
  5            Amountpaid: 15,
  6            CalculateOrdercosts: true,
  7            Code: "864056970700",
  8            Customerid: 1256,
  9            Deferredpaymentproperties: map[string]interface{}{
 10                "bankAccount": "BE54719400092697",
 11                "bankBic": "FTSBBE22",
 12                "bankName": "Stichting Mollie Payments",
 13                "transferReference": "+++695/7317/77752+++",
 14            },
 15            Deliveryaddress: &ticketmatic.Address{
 16                City: "Leuven",
 17                Street1: "Main street",
 18            },
 19            Deliveryscenarioid: 1,
 20            Deliverystatus: 2602,
 21            Expiryhandled: false,
 22            Expiryts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 23            Firstname: "John",
 24            Hasopenpaymentrequest: true,
 25            Isauthenticatedcustomer: false,
 26            Lastname: "Doe",
 27            Lookup: map[string]interface{}{
 28                "events": []interface {}{},
 29            },
 30            Nbroftickets: 0,
 31            Ordercosts: []*ticketmatic.Ordercost{
 32                &ticketmatic.Ordercost{
 33                    Orderid: 123,
 34                    Amount: 5.5,
 35                    Servicechargedefinitionid: 12,
 36                },
 37                &ticketmatic.Ordercost{
 38                    Orderid: 123,
 39                    Amount: 2,
 40                    Servicechargedefinitionid: 13,
 41                },
 42            },
 43            Payments: []*ticketmatic.Payment{
 44                &ticketmatic.Payment{
 45                    Id: 125,
 46                    Orderid: 412,
 47                    Amount: 50,
 48                    Paidts: ticketmatic.NewTime(ticketmatic.MustParseTime("2015-04-07 07:00:00")),
 49                    Paymentmethodid: 2,
 50                    Properties: nil,
 51                    Refundpaymentid: 0,
 52                },
 53            },
 54            Paymentscenarioid: 1,
 55            Paymentstatus: 0,
 56            Products: []*ticketmatic.OrderProduct{
 57                &ticketmatic.OrderProduct{
 58                    Id: 35539,
 59                    Orderid: 368,
 60                    Code: "123412341234",
 61                    Contactid: 0,
 62                    Price: 15,
 63                    Productid: 234,
 64                    Properties: nil,
 65                },
 66            },
 67            Promocodes: []string{
 68                "PROMO2015",
 69                "COOLPROMO",
 70            },
 71            Queuetokens: []int64{
 72                0,
 73                24,
 74            },
 75            Rappelhandled: false,
 76            Rappelts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 77            Saleschannelid: 1,
 78            Status: 1,
 79            Tickets: []*ticketmatic.OrderTicket{
 80                &ticketmatic.OrderTicket{
 81                    Id: 35539,
 82                    Orderid: 368,
 83                    Price: 15,
 84                    Servicecharge: 1,
 85                    Ticketholderid: 0,
 86                    Ticketname: <nil>,
 87                    Tickettypeid: 111,
 88                    Tickettypepriceid: 632,
 89                },
 90                &ticketmatic.OrderTicket{
 91                    Id: 35540,
 92                    Orderid: 368,
 93                    Price: 15,
 94                    Servicecharge: 1,
 95                    Ticketholderid: 0,
 96                    Ticketname: <nil>,
 97                    Tickettypeid: 111,
 98                    Tickettypepriceid: 632,
 99                },
100            },
101            Totalamount: 25.5,
102            Webskinid: 1,
103            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
104            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
105        },
106    },
107}

Request

1GET /api/1/{accountname}/orders HTTP/1.1

Response

  1HTTP/1.1 200 OK
  2Content-Type: application/json
  3
  4{
  5    "data": [
  6        {
  7            "orderid": 1269434,
  8            "amountpaid": 15.000000,
  9            "calculate_ordercosts": true,
 10            "code": "864056970700",
 11            "customerid": 1256,
 12            "deferredpaymentproperties": {
 13                "bankAccount": "BE54719400092697",
 14                "bankBic": "FTSBBE22",
 15                "bankName": "Stichting Mollie Payments",
 16                "transferReference": "+++695/7317/77752+++"
 17            },
 18            "deliveryaddress": {
 19                "city": "Leuven",
 20                "street1": "Main street"
 21            },
 22            "deliveryscenarioid": 1,
 23            "deliverystatus": 2602,
 24            "expiryhandled": false,
 25            "expiryts": "2014-09-26 15:24:36",
 26            "firstname": "John",
 27            "hasopenpaymentrequest": true,
 28            "isauthenticatedcustomer": false,
 29            "lastname": "Doe",
 30            "lookup": {
 31                "events": []
 32            },
 33            "nbroftickets": 0,
 34            "ordercosts": [
 35                {
 36                    "orderid": 123,
 37                    "amount": 5.500000,
 38                    "servicechargedefinitionid": 12
 39                },
 40                {
 41                    "orderid": 123,
 42                    "amount": 2.000000,
 43                    "servicechargedefinitionid": 13
 44                }
 45            ],
 46            "payments": [
 47                {
 48                    "id": 125,
 49                    "orderid": 412,
 50                    "amount": 50.000000,
 51                    "paidts": "2015-04-07 07:00:00",
 52                    "paymentmethodid": 2,
 53                    "properties": null,
 54                    "refundpaymentid": null
 55                }
 56            ],
 57            "paymentscenarioid": 1,
 58            "paymentstatus": 0,
 59            "products": [
 60                {
 61                    "id": 35539,
 62                    "orderid": 368,
 63                    "code": "123412341234",
 64                    "contactid": null,
 65                    "price": 15.000000,
 66                    "productid": 234,
 67                    "properties": null
 68                }
 69            ],
 70            "promocodes": [
 71                "PROMO2015",
 72                "COOLPROMO"
 73            ],
 74            "queuetokens": [ 0, 24 ],
 75            "rappelhandled": false,
 76            "rappelts": "2014-09-26 15:24:36",
 77            "saleschannelid": 1,
 78            "status": 1,
 79            "tickets": [
 80                {
 81                    "id": 35539,
 82                    "orderid": 368,
 83                    "price": 15.000000,
 84                    "servicecharge": 1.000000,
 85                    "ticketholderid": null,
 86                    "ticketname": null,
 87                    "tickettypeid": 111,
 88                    "tickettypepriceid": 632
 89                },
 90                {
 91                    "id": 35540,
 92                    "orderid": 368,
 93                    "price": 15.000000,
 94                    "servicecharge": 1.000000,
 95                    "ticketholderid": null,
 96                    "ticketname": null,
 97                    "tickettypeid": 111,
 98                    "tickettypepriceid": 632
 99                }
100            ],
101            "totalamount": 25.500000,
102            "webskinid": 1,
103            "createdts": "2014-09-26 15:24:36",
104            "lastupdatets": "2014-09-26 15:24:36"
105        }
106    ]
107}

Parameters

FieldDescription
filter
        </td>
        <td class="description">
            <p>A SQL query that returns order IDs</p>  <p>Can be used to do arbitrary filtering. See the <a href="db/order">database documentation for order</a> for more information.</p> 
            <strong>Example value:</strong><code>&#34;select id from tm.order where totalamount &gt; 100&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">includearchived</div>
            
        </td>
        <td class="description">
            <p>If this parameter is true, archived items will be returned as well.</p> 
            
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">lastupdatesince</div>
            
        </td>
        <td class="description">
            <p>Only include orders that have been updated since the given timestamp.</p> 
            <strong>Example value:</strong><code>&#34;2014-09-26 15:24:36&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">limit</div>
            
        </td>
        <td class="description">
            <p>Limit results to at most the given amount of orders.</p> 
            <strong>Example value:</strong><code>100</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">offset</div>
            
        </td>
        <td class="description">
            <p>Skip the first X orders.</p> 
            <strong>Example value:</strong><code>100</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">orderby</div>
            
        </td>
        <td class="description">
            <p>Order by the given field.</p>  <p>Supported values: <code>createdts</code>, <code>lastupdatets</code>.</p> 
            <strong>Example value:</strong><code>&#34;createdts&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">orderby_asc</div>
            
        </td>
        <td class="description">
            <p>Sets the direction for ordering. Default false.</p> 
            <strong>Example value:</strong><code>true</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">output</div>
            
        </td>
        <td class="description">
            <p>Output format.</p>  <p>Possible values:</p>  <ul> <li><strong>ids</strong>: Only fill the ID field</li> <li><strong>minimal</strong>: A minimal set of order fields</li> <li><strong>default</strong>: Return all order fields (also used when the output parameter is omitted)</li> <li><strong>withlookup</strong>: Returns all order fields and an additional <code>lookup</code> field which contains all dependent objects</li> </ul> 
            <strong>Example value:</strong><code>&#34;withlookup&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">searchterm</div>
            
        </td>
        <td class="description">
            <p>A text filter string.</p>  <p>Matches against the order ID or the customer details..</p> 
            <strong>Example value:</strong><code>&#34;Live&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">simplefilter</div>
            
        </td>
        <td class="description">
            <p>Filters the orders based on a given set of fields. Currently supports: <code>createdsince</code>, <code>saleschannelid</code>, <code>customerid</code>, <code>status</code>.</p> 
            <strong>Example value:</strong><code>{ &#34;saleschannelid&#34;: 123 }</code>
        </td>
    </tr>
</tbody>

Type reference: OrderQuery

Result fields

This call returns an object with an array of objects in the data field.

FieldDescription
orderid
int

Order ID

Example value:1269434
amountpaid
decimal

Total amount paid

Example value:15.000000
calculate_ordercosts
bool

Whether or not auto / script order fees should be calculated

Example value:true
code
string

Order code

Used as a unique identifier in web sales.

Example value:"864056970700"
customerid
int

Customer ID

Example value:1256
deferredpaymentproperties
map<string, mixed>

Information on the deferred payment scenario. Structure depends on payment method

Example value:{ "bankAccount": "BE54719400092697", "bankBic": "FTSBBE22", "bankName": "Stichting Mollie Payments", "transferReference": "+++695/7317/77752+++" }
deliveryaddress

Address used when delivering physically

Example value:{ "city": "Leuven", "street1": "Main street" }
deliveryscenarioid
int

Delivery scenario ID

See delivery scenarios for more info.

Example value:1
deliverystatus
int

Delivery status

Possible values:

  • 2601: Not delivered
  • 2602: Delivered
  • 2603: Changed after delivery
Example value:2602
expiryhandled
bool

Whether the expired order has been handled (and optionally expiry mail has been sent)

expiryts
timestamp

When the order will expire

Example value:"2014-09-26 15:24:36"
firstname
string

First name (only with minimal output)

Example value:"John"
hasopenpaymentrequest
bool

Indicates of the order has an open payment request with a PSP.

Example value:true
isauthenticatedcustomer
bool

Has customer authenticated?

lastname
string

Last name (only with minimal output)

Example value:"Doe"
lookup
map<string, mixed>

Related objects

See the lookup fields on the getlist operation for a full description.

Example value:{ "events": [] }
nbroftickets
int

Number of tickets in the order. Read-only

ordercosts

Order fees for the order

Example value:[ { "orderid": 123, "amount": 5.500000, "servicechargedefinitionid": 12 }, { "orderid": 123, "amount": 2.000000, "servicechargedefinitionid": 13 } ]
payments

Payments for the order

Example value:[ { "id": 125, "orderid": 412, "amount": 50.000000, "paidts": "2015-04-07 07:00:00", "paymentmethodid": 2, "properties": null, "refundpaymentid": null } ]
paymentscenarioid
int

Payment scenario ID

See payment scenarios for more info.

Example value:1
paymentstatus
int

Payment status

Possible values:

  • 0: Incomplete
  • 1: Fully paid
  • 2: Overpaid
products

Products in the order

Example value:[ { "id": 35539, "orderid": 368, "code": "123412341234", "contactid": null, "price": 15.000000, "productid": 234, "properties": null } ]
promocodes
string[]

Promocodes active for the Order

Example value:[ "PROMO2015", "COOLPROMO" ]
queuetokens
int[]

Queue tokens for rate limiting

Example value:[ 0, 24 ]
rappelhandled
bool

Whether the overdue order has been handled (and optionally reminder mail has been sent)

rappelts
timestamp

When the reminder mail will be sent

Example value:"2014-09-26 15:24:36"
saleschannelid
int

Sales channel ID

See sales channels for more info.

Example value:1
status
int

Order status

Possible values:

  • 21001: Unconfirmed
  • 21002: Confirmed
  • 21003: Archived
Example value:1
tickets

Tickets in the order

Example value:[ { "id": 35539, "orderid": 368, "price": 15.000000, "servicecharge": 1.000000, "ticketholderid": null, "ticketname": null, "tickettypeid": 111, "tickettypepriceid": 632 }, { "id": 35540, "orderid": 368, "price": 15.000000, "servicecharge": 1.000000, "ticketholderid": null, "ticketname": null, "tickettypeid": 111, "tickettypepriceid": 632 } ]
totalamount
decimal

Total order amount

Includes all costs and fees.

Example value:25.500000
webskinid
int

Reference to the webskin that is used for showing the orderdetail page.

Example value:1
createdts
timestamp

Created timestamp

Example value:"2014-09-26 15:24:36"
lastupdatets
timestamp

Last updated timestamp

Example value:"2014-09-26 15:24:36"

This type can have custom fields.

Type reference: Order[]

Lookup fields

When requested with an output parameter of withlookup, the following info will be available:

FieldDescription
contacts
map<string, Contact>

Contact details

customfieldvalues
map<string, string>

Customfield values

deliveryscenarios
map<string, DeliveryScenario>

Delivery scenarios

events
map<string, Event>

Events

paymentmethods
map<string, PaymentMethod>

Payment methods

paymentscenarios
map<string, PaymentScenario>

Payment scenarios

pricetypes
map<string, PriceType>

Price types

productcategories
map<string, ProductCategory>

Product categories

products
map<string, Product>

Products

relationtypes
map<string, string>

Relation types

saleschannels
map<string, SalesChannel>

Sales channels

servicecharges
map<string, OrderFeeDefinition>

Service charges

tickettypes
map<string, OrderTickettype>

Ticket types

vouchercodes
map<string, string>

Voucher codes