Create a new price list
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/pricing/pricelists
Example
Request
1use Ticketmatic\Endpoints\Settings\Pricing\Pricelists;
2
3$result = Pricelists::create($client, array(
4 "name" => "Dance",
5 "hasranks" => false,
6 "prices" => array(
7 "prices" => array(
8 array(
9 "prices" => array(
10 25,
11 ),
12 "pricetypeid" => 1,
13 ),
14 array(
15 "conditions" => array(
16 array(
17 "type" => "promocode",
18 "value" => "UGENT2013",
19 ),
20 ),
21 "prices" => array(
22 30,
23 ),
24 "pricetypeid" => 2,
25 ),
26 ),
27 "seatrankids" => null,
28 ),
29));
Response
1object(\Ticketmatic\Model\PriceList) (7) {
2 ["id"]=>
3 int(0)
4 ["name"]=>
5 string(5) "Dance"
6 ["hasranks"]=>
7 bool(false)
8 ["prices"]=>
9 object(\Ticketmatic\Model\PricelistPrices) (2) {
10 ["prices"]=>
11 array(2) {
12 [0]=>
13 object(\Ticketmatic\Model\PricelistPrice) (2) {
14 ["prices"]=>
15 array(1) {
16 [0]=>
17 float(25.000000)
18 }
19 ["pricetypeid"]=>
20 int(0)
21 }
22 [1]=>
23 object(\Ticketmatic\Model\PricelistPrice) (3) {
24 ["conditions"]=>
25 array(1) {
26 [0]=>
27 object(\Ticketmatic\Model\PricelistPriceCondition) (2) {
28 ["type"]=>
29 string(9) "promocode"
30 ["value"]=>
31 string(9) "UGENT2013"
32 }
33 }
34 ["prices"]=>
35 array(1) {
36 [0]=>
37 float(30.000000)
38 }
39 ["pricetypeid"]=>
40 int(0)
41 }
42 }
43 ["seatrankids"]=>
44 NULL
45 }
46 ["isarchived"]=>
47 bool(false)
48 ["createdts"]=>
49 object(\DateTime) (3) {
50 ["date"]=>
51 string(26) "2014-09-26 15:24:36.000000"
52 ["timezone_type"]=>
53 int(3)
54 ["timezone"]=>
55 string(3) "UTC"
56 }
57 ["lastupdatets"]=>
58 object(\DateTime) (3) {
59 ["date"]=>
60 string(26) "2014-09-26 15:24:36.000000"
61 ["timezone_type"]=>
62 int(3)
63 ["timezone"]=>
64 string(3) "UTC"
65 }
66}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/pricing/pricelists"
4)
5
6result, err := pricelists.Create(client, &ticketmatic.PriceList{
7 Name: "Dance",
8 Hasranks: false,
9 Prices: &ticketmatic.PricelistPrices{
10 Prices: []*ticketmatic.PricelistPrice{
11 &ticketmatic.PricelistPrice{
12 Prices: []float64{
13 25,
14 },
15 Pricetypeid: 1,
16 },
17 &ticketmatic.PricelistPrice{
18 Conditions: []*ticketmatic.PricelistPriceCondition{
19 &ticketmatic.PricelistPriceCondition{
20 Type: "promocode",
21 Value: "UGENT2013",
22 },
23 },
24 Prices: []float64{
25 30,
26 },
27 Pricetypeid: 2,
28 },
29 },
30 Seatrankids: nil,
31 },
32})
Response
1result := &ticketmatic.PriceList{
2 Id: 123,
3 Name: "Dance",
4 Hasranks: false,
5 Prices: &ticketmatic.PricelistPrices{
6 Prices: []*ticketmatic.PricelistPrice{
7 &ticketmatic.PricelistPrice{
8 Prices: []float64{
9 25,
10 },
11 Pricetypeid: 1,
12 },
13 &ticketmatic.PricelistPrice{
14 Conditions: []*ticketmatic.PricelistPriceCondition{
15 &ticketmatic.PricelistPriceCondition{
16 Type: "promocode",
17 Value: "UGENT2013",
18 },
19 },
20 Prices: []float64{
21 30,
22 },
23 Pricetypeid: 2,
24 },
25 },
26 Seatrankids: nil,
27 },
28 Isarchived: false,
29 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
30 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
31}
Request
1POST /api/1/{accountname}/settings/pricing/pricelists HTTP/1.1
2Content-Type: application/json
3
4{
5 "name": "Dance",
6 "hasranks": false,
7 "prices": {
8 "prices": [
9 {
10 "prices": [ 25.000000 ],
11 "pricetypeid": 1
12 },
13 {
14 "conditions": [
15 {
16 "type": "promocode",
17 "value": "UGENT2013"
18 }
19 ],
20 "prices": [ 30.000000 ],
21 "pricetypeid": 2
22 }
23 ],
24 "seatrankids": null
25 }
26}
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 123,
6 "name": "Dance",
7 "hasranks": false,
8 "prices": {
9 "prices": [
10 {
11 "prices": [ 25.000000 ],
12 "pricetypeid": 1
13 },
14 {
15 "conditions": [
16 {
17 "type": "promocode",
18 "value": "UGENT2013"
19 }
20 ],
21 "prices": [ 30.000000 ],
22 "pricetypeid": 2
23 }
24 ],
25 "seatrankids": null
26 },
27 "isarchived": false,
28 "createdts": "2014-09-26 15:24:36",
29 "lastupdatets": "2014-09-26 15:24:36"
30}
Request body fields
Field | Description |
---|---|
name string (required) | Name for the pricelist Example value:"Dance" |
hasranks bool (required) | Boolean indicating whether this pricelist has ranks or not
|
Type reference: PriceList
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
name string | Name for the pricelist Example value:"Dance" |
hasranks bool | Boolean indicating whether this pricelist has ranks or not |
prices | Definition of the actual prices and conditions for the pricelist Example value:{ "prices": [ { "prices": [ 25.000000 ], "pricetypeid": 1 }, { "conditions": [ { "type": "promocode", "value": "UGENT2013" } ], "prices": [ 30.000000 ], "pricetypeid": 2 } ], "seatrankids": null } |
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: PriceList