Add tickets to order

Content

Resource URL

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

Description

When adding tickets, this is limited to 50 tickets per call. Note: This method may return a 429 Rate Limit Exceeded status when there is too much demand. See the article about rate limiting for more information on how to handle this.

Example

Request

 1use Ticketmatic\Endpoints\Orders;
 2
 3$result = Orders::addtickets($client, $id, array(
 4    "onlysinglerow" => true,
 5    "tickets" => array(
 6        array(
 7            "tickettypepriceid" => 3,
 8        ),
 9    ),
10));

Response

 1object(\Ticketmatic\Model\AddItemsResult) (2) {
 2  ["ids"]=>
 3  array(3) {
 4    [0]=>
 5    int(0)
 6    [1]=>
 7    int(0)
 8    [2]=>
 9    int(0)
10  }
11  ["order"]=>
12  object(\Ticketmatic\Model\Order) (1) {
13    ["orderid"]=>
14    int(0)
15  }
16}
17

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/orders"
 4)
 5
 6result, err := orders.Addtickets(client, id, &ticketmatic.AddTickets{
 7    Onlysinglerow: true,
 8    Tickets: []*ticketmatic.CreateTicket{
 9        &ticketmatic.CreateTicket{
10            Tickettypepriceid: 3,
11        },
12    },
13})

Response

 1result := &ticketmatic.AddItemsResult{
 2    Ids: []int64{
 3        1,
 4        2,
 5        5,
 6    },
 7    Order: &ticketmatic.Order{
 8        Orderid: 1269434,
 9    },
10}

Request

 1POST /api/1/{accountname}/orders/{id}/tickets HTTP/1.1
 2Content-Type: application/json
 3
 4{
 5    "onlysinglerow": true,
 6    "tickets": [
 7        {
 8            "tickettypepriceid": 3
 9        }
10    ]
11}

Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5    "ids": [ 1, 2, 5 ],
6    "order": {
7        "orderid": 1269434
8    }
9}

Request body fields

FieldDescription
onlysinglerow
bool

If this is set adding the tickets will only succeed if all tickets can be placed on a single row

Example value:true
tickets
CreateTicket[] 
(required)

Ticket information

Example value:[ { "tickettypepriceid": 3 } ]

Type reference: AddTickets

Result fields

FieldDescription
ids
int[]

Ids of the items that were added

Example value:[ 1, 2, 5 ]
order

The modified order

Example value:{ "orderid": 1269434 }

Type reference: AddItemsResult