Get a single product

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/products/{id}

Example

Request

1use Ticketmatic\Endpoints\Settings\Products;
2
3$result = Products::get($client, $id);

Response

  1object(\Ticketmatic\Model\Product) (24) {
  2  ["id"]=>
  3  int(0)
  4  ["typeid"]=>
  5  int(0)
  6  ["categoryid"]=>
  7  int(0)
  8  ["layoutid"]=>
  9  int(0)
 10  ["name"]=>
 11  string(7) "T-shirt"
 12  ["asksubscribers"]=>
 13  bool(true)
 14  ["code"]=>
 15  string(12) "123412341234"
 16  ["description"]=>
 17  string(26) "Longer product description"
 18  ["groupbycustomfield"]=>
 19  int(0)
 20  ["image"]=>
 21  string(38) "/products/1282/image.5b3a145b576ab.jpg"
 22  ["instancevalues"]=>
 23  object(\Ticketmatic\Model\ProductInstancevalues) (2) {
 24    ["default"]=>
 25    object(\Ticketmatic\Model\ProductInstanceValue) (2) {
 26      ["price"]=>
 27      float(25.000000)
 28      ["voucher"]=>
 29      object(\Ticketmatic\Model\ProductVoucherValue) (2) {
 30        ["amount"]=>
 31        float(10.000000)
 32        ["voucherid"]=>
 33        int(0)
 34      }
 35    }
 36    ["exceptions"]=>
 37    array(2) {
 38      [0]=>
 39      object(\Ticketmatic\Model\ProductInstanceException) (2) {
 40        ["properties"]=>
 41        array(2) {
 42          ["colour"]=>
 43            array(1) {
 44              [0]=>
 45              string(3) "red"
 46            }
 47          ["size"]=>
 48            array(1) {
 49              [0]=>
 50              string(1) "S"
 51            }
 52        }
 53        ["value"]=>
 54        object(\Ticketmatic\Model\ProductInstanceValue) (2) {
 55          ["price"]=>
 56          float(15.000000)
 57          ["voucher"]=>
 58          object(\Ticketmatic\Model\ProductVoucherValue) (2) {
 59            ["amount"]=>
 60            float(10.000000)
 61            ["voucherid"]=>
 62            int(0)
 63          }
 64        }
 65      }
 66      [1]=>
 67      object(\Ticketmatic\Model\ProductInstanceException) (2) {
 68        ["properties"]=>
 69        array(2) {
 70          ["colour"]=>
 71            array(1) {
 72              [0]=>
 73              string(3) "red"
 74            }
 75          ["size"]=>
 76            array(1) {
 77              [0]=>
 78              string(1) "M"
 79            }
 80        }
 81        ["value"]=>
 82        object(\Ticketmatic\Model\ProductInstanceValue) (2) {
 83          ["price"]=>
 84          float(17.000000)
 85          ["voucher"]=>
 86          object(\Ticketmatic\Model\ProductVoucherValue) (2) {
 87            ["amount"]=>
 88            float(30.000000)
 89            ["voucherid"]=>
 90            int(0)
 91          }
 92        }
 93      }
 94    }
 95  }
 96  ["maxadditionaltickets"]=>
 97  int(0)
 98  ["printtickets"]=>
 99  bool(true)
100  ["properties"]=>
101  array(2) {
102    [0]=>
103    object(\Ticketmatic\Model\ProductProperty) (4) {
104      ["name"]=>
105      string(4) "Size"
106      ["description"]=>
107      string(19) "Size of the t-shirt"
108      ["key"]=>
109      string(4) "size"
110      ["values"]=>
111      array(3) {
112        [0]=>
113        object(\Ticketmatic\Model\KeyValueItem) (2) {
114          ["key"]=>
115          string(1) "S"
116          ["value"]=>
117          string(5) "Small"
118        }
119        [1]=>
120        object(\Ticketmatic\Model\KeyValueItem) (2) {
121          ["key"]=>
122          string(1) "M"
123          ["value"]=>
124          string(6) "Medium"
125        }
126        [2]=>
127        object(\Ticketmatic\Model\KeyValueItem) (2) {
128          ["key"]=>
129          string(1) "L"
130          ["value"]=>
131          string(5) "Large"
132        }
133      }
134    }
135    [1]=>
136    object(\Ticketmatic\Model\ProductProperty) (4) {
137      ["name"]=>
138      string(6) "Colour"
139      ["description"]=>
140      string(21) "Colour of the t-shirt"
141      ["key"]=>
142      string(6) "colour"
143      ["values"]=>
144      array(2) {
145        [0]=>
146        object(\Ticketmatic\Model\KeyValueItem) (2) {
147          ["key"]=>
148          string(3) "red"
149          ["value"]=>
150          string(3) "Red"
151        }
152        [1]=>
153        object(\Ticketmatic\Model\KeyValueItem) (2) {
154          ["key"]=>
155          string(5) "green"
156          ["value"]=>
157          string(5) "Green"
158        }
159      }
160    }
161  }
162  ["queuetoken"]=>
163  int(0)
164  ["saleendts"]=>
165  object(\DateTime) (3) {
166    ["date"]=>
167    string(26) "2016-01-01 00:00:00.000000"
168    ["timezone_type"]=>
169    int(3)
170    ["timezone"]=>
171    string(3) "UTC"
172  }
173  ["saleschannels"]=>
174  array(3) {
175    [0]=>
176    int(0)
177    [1]=>
178    int(0)
179    [2]=>
180    int(0)
181  }
182  ["salestartts"]=>
183  object(\DateTime) (3) {
184    ["date"]=>
185    string(26) "2016-01-01 00:00:00.000000"
186    ["timezone_type"]=>
187    int(3)
188    ["timezone"]=>
189    string(3) "UTC"
190  }
191  ["salestatusmessagesid"]=>
192  int(0)
193  ["shortdescription"]=>
194  string(38) "The new t-shirt is made of 100% cotton"
195  ["translations"]=>
196  array(2) {
197    ["properties:size:L:nl"]=>
198    string(5) "Groot"
199    ["properties:size:S:nl"]=>
200    string(5) "Klein"
201  }
202  ["isarchived"]=>
203  bool(false)
204  ["createdts"]=>
205  object(\DateTime) (3) {
206    ["date"]=>
207    string(26) "2014-09-26 15:24:36.000000"
208    ["timezone_type"]=>
209    int(3)
210    ["timezone"]=>
211    string(3) "UTC"
212  }
213  ["lastupdatets"]=>
214  object(\DateTime) (3) {
215    ["date"]=>
216    string(26) "2014-09-26 15:24:36.000000"
217    ["timezone_type"]=>
218    int(3)
219    ["timezone"]=>
220    string(3) "UTC"
221  }
222}

Request

1import (
2    "github.com/ticketmatic/tm-go/ticketmatic"
3    "github.com/ticketmatic/tm-go/ticketmatic/settings/products"
4)
5
6result, err := products.Get(client, id)

Response

  1result := &ticketmatic.Product{
  2    Id: 123,
  3    Typeid: 26001,
  4    Categoryid: 1,
  5    Layoutid: 1,
  6    Name: "T-shirt",
  7    Asksubscribers: true,
  8    Code: "123412341234",
  9    Description: "Longer product description",
 10    Groupbycustomfield: 10003,
 11    Image: "/products/1282/image.5b3a145b576ab.jpg",
 12    Instancevalues: &ticketmatic.ProductInstancevalues{
 13        Default: &ticketmatic.ProductInstanceValue{
 14            Price: 25,
 15            Voucher: &ticketmatic.ProductVoucherValue{
 16                Amount: 10,
 17                Voucherid: 123,
 18            },
 19        },
 20        Exceptions: []*ticketmatic.ProductInstanceException{
 21            &ticketmatic.ProductInstanceException{
 22                Properties: map[string][]string{
 23                    "colour": []string{
 24                        "red",
 25                    },
 26                    "size": []string{
 27                        "S",
 28                    },
 29                },
 30                Value: &ticketmatic.ProductInstanceValue{
 31                    Price: 15,
 32                    Voucher: &ticketmatic.ProductVoucherValue{
 33                        Amount: 10,
 34                        Voucherid: 123,
 35                    },
 36                },
 37            },
 38            &ticketmatic.ProductInstanceException{
 39                Properties: map[string][]string{
 40                    "colour": []string{
 41                        "red",
 42                    },
 43                    "size": []string{
 44                        "M",
 45                    },
 46                },
 47                Value: &ticketmatic.ProductInstanceValue{
 48                    Price: 17,
 49                    Voucher: &ticketmatic.ProductVoucherValue{
 50                        Amount: 30,
 51                        Voucherid: 124,
 52                    },
 53                },
 54            },
 55        },
 56    },
 57    Maxadditionaltickets: 3,
 58    Printtickets: true,
 59    Properties: []*ticketmatic.ProductProperty{
 60        &ticketmatic.ProductProperty{
 61            Name: "Size",
 62            Description: "Size of the t-shirt",
 63            Key: "size",
 64            Values: []*ticketmatic.KeyValueItem{
 65                &ticketmatic.KeyValueItem{
 66                    Key: "S",
 67                    Value: "Small",
 68                },
 69                &ticketmatic.KeyValueItem{
 70                    Key: "M",
 71                    Value: "Medium",
 72                },
 73                &ticketmatic.KeyValueItem{
 74                    Key: "L",
 75                    Value: "Large",
 76                },
 77            },
 78        },
 79        &ticketmatic.ProductProperty{
 80            Name: "Colour",
 81            Description: "Colour of the t-shirt",
 82            Key: "colour",
 83            Values: []*ticketmatic.KeyValueItem{
 84                &ticketmatic.KeyValueItem{
 85                    Key: "red",
 86                    Value: "Red",
 87                },
 88                &ticketmatic.KeyValueItem{
 89                    Key: "green",
 90                    Value: "Green",
 91                },
 92            },
 93        },
 94    },
 95    Queuetoken: 421,
 96    Saleendts: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
 97    Saleschannels: []int64{
 98        1,
 99        2,
100        3,
101    },
102    Salestartts: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
103    Salestatusmessagesid: 1,
104    Shortdescription: "The new t-shirt is made of 100% cotton",
105    Translations: map[string]string{
106        "properties:size:L:nl": "Groot",
107        "properties:size:S:nl": "Klein",
108    },
109    Isarchived: false,
110    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
111    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
112}

Request

1GET /api/1/{accountname}/settings/products/{id} HTTP/1.1

Response

  1HTTP/1.1 200 OK
  2Content-Type: application/json
  3
  4{
  5    "id": 123,
  6    "typeid": 26001,
  7    "categoryid": 1,
  8    "layoutid": 1,
  9    "name": "T-shirt",
 10    "asksubscribers": true,
 11    "code": "123412341234",
 12    "description": "Longer product description",
 13    "groupbycustomfield": 10003,
 14    "image": "/products/1282/image.5b3a145b576ab.jpg",
 15    "instancevalues": {
 16        "default": {
 17            "price": 25.000000,
 18            "voucher": {
 19                "amount": 10.000000,
 20                "voucherid": 123
 21            }
 22        },
 23        "exceptions": [
 24            {
 25                "properties": {
 26                    "colour": [
 27                        "red"
 28                    ],
 29                    "size": [
 30                        "S"
 31                    ]
 32                },
 33                "value": {
 34                    "price": 15.000000,
 35                    "voucher": {
 36                        "amount": 10.000000,
 37                        "voucherid": 123
 38                    }
 39                }
 40            },
 41            {
 42                "properties": {
 43                    "colour": [
 44                        "red"
 45                    ],
 46                    "size": [
 47                        "M"
 48                    ]
 49                },
 50                "value": {
 51                    "price": 17.000000,
 52                    "voucher": {
 53                        "amount": 30.000000,
 54                        "voucherid": 124
 55                    }
 56                }
 57            }
 58        ]
 59    },
 60    "maxadditionaltickets": 3,
 61    "printtickets": true,
 62    "properties": [
 63        {
 64            "name": "Size",
 65            "description": "Size of the t-shirt",
 66            "key": "size",
 67            "values": [
 68                {
 69                    "key": "S",
 70                    "value": "Small"
 71                },
 72                {
 73                    "key": "M",
 74                    "value": "Medium"
 75                },
 76                {
 77                    "key": "L",
 78                    "value": "Large"
 79                }
 80            ]
 81        },
 82        {
 83            "name": "Colour",
 84            "description": "Colour of the t-shirt",
 85            "key": "colour",
 86            "values": [
 87                {
 88                    "key": "red",
 89                    "value": "Red"
 90                },
 91                {
 92                    "key": "green",
 93                    "value": "Green"
 94                }
 95            ]
 96        }
 97    ],
 98    "queuetoken": 421,
 99    "saleendts": "2016-01-01 00:00:00",
100    "saleschannels": [ 1, 2, 3 ],
101    "salestartts": "2016-01-01 00:00:00",
102    "salestatusmessagesid": 1,
103    "shortdescription": "The new t-shirt is made of 100% cotton",
104    "translations": {
105        "properties:size:L:nl": "Groot",
106        "properties:size:S:nl": "Klein"
107    },
108    "isarchived": false,
109    "createdts": "2014-09-26 15:24:36",
110    "lastupdatets": "2014-09-26 15:24:36"
111}

Result fields

FieldDescription
id
int

Unique ID

Example value:123
typeid
int

Type ID

Example value:26001
categoryid
int

Category for the product. Categories can be managed in account parameters and indicate the labels for a single and multiple product and also what labels to use for the holders of the product. If not set, the UI will fallback to default labels.

Example value:1
layoutid
int

Optional layout for the product. If not specified, there will be no ticket generated for the product

Example value:1
name

Name for the product

Example value:"T-shirt"
asksubscribers
bool

If true, subscriber info is requested for each bundle in websales.

Example value:true
code
string

Unique 12-digit for the product

Example value:"123412341234"
description

Description for the product

Example value:"Longer product description"
groupbycustomfield
int

The customfield that is used to group the option bundle in the UI (websales and backoffice)

Example value:10003
image
string

Reference to product image

Example value:"/products/1282/image.5b3a145b576ab.jpg"
instancevalues

Instancevalues control the price for a product and for non simple products it also controls the content of the product. All products should have a default instancevalue and a set of exceptions (if there are any). If no specific exception is found for the selected product, the default instancevalue is used.

Example value:{ "default": { "price": 25.000000, "voucher": { "amount": 10.000000, "voucherid": 123 } }, "exceptions": [ { "properties": { "colour": [ "red" ], "size": [ "S" ] }, "value": { "price": 15.000000, "voucher": { "amount": 10.000000, "voucherid": 123 } } }, { "properties": { "colour": [ "red" ], "size": [ "M" ] }, "value": { "price": 17.000000, "voucher": { "amount": 30.000000, "voucherid": 124 } } } ] }
maxadditionaltickets
int

The amount of individual tickets per event that can be purchased alongside this bundle.

Example value:3
printtickets
bool

If true, tickets for items that belong to the product will be printed when printing the product.

Example value:true
properties

Definition of possible properties for the product. A product can have one or more properties. Properties can be used to introduce variants of a product (sizes of a t-shirt for example).

Example value:[ { "name": "Size", "description": "Size of the t-shirt", "key": "size", "values": [ { "key": "S", "value": "Small" }, { "key": "M", "value": "Medium" }, { "key": "L", "value": "Large" } ] }, { "name": "Colour", "description": "Colour of the t-shirt", "key": "colour", "values": [ { "key": "red", "value": "Red" }, { "key": "green", "value": "Green" } ] } ]
queuetoken
int

Queue ID

See rate limiting for more info.

Example value:421
saleendts
timestamp

End of sales

Example value:"2016-01-01 00:00:00"
saleschannels
int[]

Sales is active for these saleschannels

Example value:[ 1, 2, 3 ]
salestartts
timestamp

Start of sales

Example value:"2016-01-01 00:00:00"
salestatusmessagesid
int

Sale status messages in use for this product

Example value:1
shortdescription

Short description for the product

Example value:"The new t-shirt is made of 100% cotton"
translations
map<string, string>

Translations for the product properties

Example value:{ "properties:size:L:nl": "Groot", "properties:size:S:nl": "Klein" }
isarchived
bool

Whether or not this item is archived

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"

Type reference: Product