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) (20) {
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 ["code"]=>
13 string(12) "123412341234"
14 ["description"]=>
15 string(38) "The new t-shirt is made of 100% cotton"
16 ["groupbycustomfield"]=>
17 int(0)
18 ["instancevalues"]=>
19 object(\Ticketmatic\Model\ProductInstancevalues) (2) {
20 ["default"]=>
21 object(\Ticketmatic\Model\ProductInstanceValue) (2) {
22 ["price"]=>
23 float(25.000000)
24 ["voucher"]=>
25 object(\Ticketmatic\Model\ProductVoucherValue) (2) {
26 ["amount"]=>
27 float(10.000000)
28 ["voucherid"]=>
29 int(0)
30 }
31 }
32 ["exceptions"]=>
33 array(2) {
34 [0]=>
35 object(\Ticketmatic\Model\ProductInstanceException) (2) {
36 ["properties"]=>
37 array(2) {
38 ["colour"]=>
39 array(1) {
40 [0]=>
41 string(3) "red"
42 }
43 ["size"]=>
44 array(1) {
45 [0]=>
46 string(1) "S"
47 }
48 }
49 ["value"]=>
50 object(\Ticketmatic\Model\ProductInstanceValue) (2) {
51 ["price"]=>
52 float(15.000000)
53 ["voucher"]=>
54 object(\Ticketmatic\Model\ProductVoucherValue) (2) {
55 ["amount"]=>
56 float(10.000000)
57 ["voucherid"]=>
58 int(0)
59 }
60 }
61 }
62 [1]=>
63 object(\Ticketmatic\Model\ProductInstanceException) (2) {
64 ["properties"]=>
65 array(2) {
66 ["colour"]=>
67 array(1) {
68 [0]=>
69 string(3) "red"
70 }
71 ["size"]=>
72 array(1) {
73 [0]=>
74 string(1) "M"
75 }
76 }
77 ["value"]=>
78 object(\Ticketmatic\Model\ProductInstanceValue) (2) {
79 ["price"]=>
80 float(17.000000)
81 ["voucher"]=>
82 object(\Ticketmatic\Model\ProductVoucherValue) (2) {
83 ["amount"]=>
84 float(30.000000)
85 ["voucherid"]=>
86 int(0)
87 }
88 }
89 }
90 }
91 }
92 ["maxadditionaltickets"]=>
93 int(0)
94 ["printtickets"]=>
95 bool(true)
96 ["properties"]=>
97 array(2) {
98 [0]=>
99 object(\Ticketmatic\Model\ProductProperty) (4) {
100 ["name"]=>
101 string(4) "Size"
102 ["description"]=>
103 string(19) "Size of the t-shirt"
104 ["key"]=>
105 string(4) "size"
106 ["values"]=>
107 array(3) {
108 [0]=>
109 object(\Ticketmatic\Model\KeyValueItem) (2) {
110 ["key"]=>
111 string(1) "S"
112 ["value"]=>
113 string(5) "Small"
114 }
115 [1]=>
116 object(\Ticketmatic\Model\KeyValueItem) (2) {
117 ["key"]=>
118 string(1) "M"
119 ["value"]=>
120 string(6) "Medium"
121 }
122 [2]=>
123 object(\Ticketmatic\Model\KeyValueItem) (2) {
124 ["key"]=>
125 string(1) "L"
126 ["value"]=>
127 string(5) "Large"
128 }
129 }
130 }
131 [1]=>
132 object(\Ticketmatic\Model\ProductProperty) (4) {
133 ["name"]=>
134 string(6) "Colour"
135 ["description"]=>
136 string(21) "Colour of the t-shirt"
137 ["key"]=>
138 string(6) "colour"
139 ["values"]=>
140 array(2) {
141 [0]=>
142 object(\Ticketmatic\Model\KeyValueItem) (2) {
143 ["key"]=>
144 string(3) "red"
145 ["value"]=>
146 string(3) "Red"
147 }
148 [1]=>
149 object(\Ticketmatic\Model\KeyValueItem) (2) {
150 ["key"]=>
151 string(5) "green"
152 ["value"]=>
153 string(5) "Green"
154 }
155 }
156 }
157 }
158 ["queuetoken"]=>
159 int(0)
160 ["saleendts"]=>
161 object(\DateTime) (3) {
162 ["date"]=>
163 string(26) "2016-01-01 00:00:00.000000"
164 ["timezone_type"]=>
165 int(3)
166 ["timezone"]=>
167 string(3) "UTC"
168 }
169 ["saleschannels"]=>
170 array(3) {
171 [0]=>
172 int(0)
173 [1]=>
174 int(0)
175 [2]=>
176 int(0)
177 }
178 ["salestartts"]=>
179 object(\DateTime) (3) {
180 ["date"]=>
181 string(26) "2016-01-01 00:00:00.000000"
182 ["timezone_type"]=>
183 int(3)
184 ["timezone"]=>
185 string(3) "UTC"
186 }
187 ["translations"]=>
188 array(2) {
189 ["properties:size:L:nl"]=>
190 string(5) "Groot"
191 ["properties:size:S:nl"]=>
192 string(5) "Klein"
193 }
194 ["isarchived"]=>
195 bool(false)
196 ["createdts"]=>
197 object(\DateTime) (3) {
198 ["date"]=>
199 string(26) "2014-09-26 15:24:36.000000"
200 ["timezone_type"]=>
201 int(3)
202 ["timezone"]=>
203 string(3) "UTC"
204 }
205 ["lastupdatets"]=>
206 object(\DateTime) (3) {
207 ["date"]=>
208 string(26) "2014-09-26 15:24:36.000000"
209 ["timezone_type"]=>
210 int(3)
211 ["timezone"]=>
212 string(3) "UTC"
213 }
214}
215
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 Code: "123412341234",
8 Description: "The new t-shirt is made of 100% cotton",
9 Groupbycustomfield: 10003,
10 Instancevalues: &ticketmatic.ProductInstancevalues{
11 Default: &ticketmatic.ProductInstanceValue{
12 Price: 25,
13 Voucher: &ticketmatic.ProductVoucherValue{
14 Amount: 10,
15 Voucherid: 123,
16 },
17 },
18 Exceptions: []*ticketmatic.ProductInstanceException{
19 &ticketmatic.ProductInstanceException{
20 Properties: map[string][]string{
21 "colour": []string{
22 "red",
23 },
24 "size": []string{
25 "S",
26 },
27 },
28 Value: &ticketmatic.ProductInstanceValue{
29 Price: 15,
30 Voucher: &ticketmatic.ProductVoucherValue{
31 Amount: 10,
32 Voucherid: 123,
33 },
34 },
35 },
36 &ticketmatic.ProductInstanceException{
37 Properties: map[string][]string{
38 "colour": []string{
39 "red",
40 },
41 "size": []string{
42 "M",
43 },
44 },
45 Value: &ticketmatic.ProductInstanceValue{
46 Price: 17,
47 Voucher: &ticketmatic.ProductVoucherValue{
48 Amount: 30,
49 Voucherid: 124,
50 },
51 },
52 },
53 },
54 },
55 Maxadditionaltickets: 3,
56 Printtickets: true,
57 Properties: []*ticketmatic.ProductProperty{
58 &ticketmatic.ProductProperty{
59 Name: "Size",
60 Description: "Size of the t-shirt",
61 Key: "size",
62 Values: []*ticketmatic.KeyValueItem{
63 &ticketmatic.KeyValueItem{
64 Key: "S",
65 Value: "Small",
66 },
67 &ticketmatic.KeyValueItem{
68 Key: "M",
69 Value: "Medium",
70 },
71 &ticketmatic.KeyValueItem{
72 Key: "L",
73 Value: "Large",
74 },
75 },
76 },
77 &ticketmatic.ProductProperty{
78 Name: "Colour",
79 Description: "Colour of the t-shirt",
80 Key: "colour",
81 Values: []*ticketmatic.KeyValueItem{
82 &ticketmatic.KeyValueItem{
83 Key: "red",
84 Value: "Red",
85 },
86 &ticketmatic.KeyValueItem{
87 Key: "green",
88 Value: "Green",
89 },
90 },
91 },
92 },
93 Queuetoken: 421,
94 Saleendts: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
95 Saleschannels: []int64{
96 1,
97 2,
98 3,
99 },
100 Salestartts: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
101 Translations: map[string]string{
102 "properties:size:L:nl": "Groot",
103 "properties:size:S:nl": "Klein",
104 },
105 Isarchived: false,
106 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
107 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
108}
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 "code": "123412341234",
11 "description": "The new t-shirt is made of 100% cotton",
12 "groupbycustomfield": 10003,
13 "instancevalues": {
14 "default": {
15 "price": 25.000000,
16 "voucher": {
17 "amount": 10.000000,
18 "voucherid": 123
19 }
20 },
21 "exceptions": [
22 {
23 "properties": {
24 "colour": [
25 "red"
26 ],
27 "size": [
28 "S"
29 ]
30 },
31 "value": {
32 "price": 15.000000,
33 "voucher": {
34 "amount": 10.000000,
35 "voucherid": 123
36 }
37 }
38 },
39 {
40 "properties": {
41 "colour": [
42 "red"
43 ],
44 "size": [
45 "M"
46 ]
47 },
48 "value": {
49 "price": 17.000000,
50 "voucher": {
51 "amount": 30.000000,
52 "voucherid": 124
53 }
54 }
55 }
56 ]
57 },
58 "maxadditionaltickets": 3,
59 "printtickets": true,
60 "properties": [
61 {
62 "name": "Size",
63 "description": "Size of the t-shirt",
64 "key": "size",
65 "values": [
66 {
67 "key": "S",
68 "value": "Small"
69 },
70 {
71 "key": "M",
72 "value": "Medium"
73 },
74 {
75 "key": "L",
76 "value": "Large"
77 }
78 ]
79 },
80 {
81 "name": "Colour",
82 "description": "Colour of the t-shirt",
83 "key": "colour",
84 "values": [
85 {
86 "key": "red",
87 "value": "Red"
88 },
89 {
90 "key": "green",
91 "value": "Green"
92 }
93 ]
94 }
95 ],
96 "queuetoken": 421,
97 "saleendts": "2016-01-01 00:00:00",
98 "saleschannels": [ 1, 2, 3 ],
99 "salestartts": "2016-01-01 00:00:00",
100 "translations": {
101 "properties:size:L:nl": "Groot",
102 "properties:size:S:nl": "Klein"
103 },
104 "isarchived": false,
105 "createdts": "2014-09-26 15:24:36",
106 "lastupdatets": "2014-09-26 15:24:36"
107}
Result fields
Field | Description |
---|---|
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" |
code string | Unique 12-digit for the product Example value:"123412341234" |
description | Description for the product Example value:"The new t-shirt is made of 100% cotton" |
groupbycustomfield int | The customfield that is used to group the option bundle in the UI (websales and backoffice) Example value:10003 |
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" |
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