Create a new ticket fee
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/pricing/ticketfees
Example
Request
1use Ticketmatic\Endpoints\Settings\Pricing\Ticketfees;
2
3$result = Ticketfees::create($client, array(
4 "name" => "Fixed reservation fee",
5 "rules" => array(
6 "default" => array(
7 array(
8 "saleschannelid" => 1,
9 "status" => "fixedfee",
10 "value" => 1,
11 ),
12 array(
13 "saleschannelid" => 2,
14 "status" => "fixedfee",
15 "value" => 1,
16 ),
17 ),
18 ),
19));
Response
1object(\Ticketmatic\Model\TicketFee) (6) {
2 ["id"]=>
3 int(0)
4 ["name"]=>
5 string(21) "Fixed reservation fee"
6 ["rules"]=>
7 object(\Ticketmatic\Model\TicketfeeRules) (1) {
8 ["default"]=>
9 array(2) {
10 [0]=>
11 object(\Ticketmatic\Model\TicketfeeSaleschannelRule) (3) {
12 ["saleschannelid"]=>
13 int(0)
14 ["status"]=>
15 string(8) "fixedfee"
16 ["value"]=>
17 float(1.000000)
18 }
19 [1]=>
20 object(\Ticketmatic\Model\TicketfeeSaleschannelRule) (3) {
21 ["saleschannelid"]=>
22 int(0)
23 ["status"]=>
24 string(8) "fixedfee"
25 ["value"]=>
26 float(1.000000)
27 }
28 }
29 }
30 ["isarchived"]=>
31 bool(false)
32 ["createdts"]=>
33 object(\DateTime) (3) {
34 ["date"]=>
35 string(26) "2014-09-26 15:24:36.000000"
36 ["timezone_type"]=>
37 int(3)
38 ["timezone"]=>
39 string(3) "UTC"
40 }
41 ["lastupdatets"]=>
42 object(\DateTime) (3) {
43 ["date"]=>
44 string(26) "2014-09-26 15:24:36.000000"
45 ["timezone_type"]=>
46 int(3)
47 ["timezone"]=>
48 string(3) "UTC"
49 }
50}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/pricing/ticketfees"
4)
5
6result, err := ticketfees.Create(client, &ticketmatic.TicketFee{
7 Name: "Fixed reservation fee",
8 Rules: &ticketmatic.TicketfeeRules{
9 Default: []*ticketmatic.TicketfeeSaleschannelRule{
10 &ticketmatic.TicketfeeSaleschannelRule{
11 Saleschannelid: 1,
12 Status: "fixedfee",
13 Value: 1,
14 },
15 &ticketmatic.TicketfeeSaleschannelRule{
16 Saleschannelid: 2,
17 Status: "fixedfee",
18 Value: 1,
19 },
20 },
21 },
22})
Response
1result := &ticketmatic.TicketFee{
2 Id: 123,
3 Name: "Fixed reservation fee",
4 Rules: &ticketmatic.TicketfeeRules{
5 Default: []*ticketmatic.TicketfeeSaleschannelRule{
6 &ticketmatic.TicketfeeSaleschannelRule{
7 Saleschannelid: 1,
8 Status: "fixedfee",
9 Value: 1,
10 },
11 &ticketmatic.TicketfeeSaleschannelRule{
12 Saleschannelid: 2,
13 Status: "fixedfee",
14 Value: 1,
15 },
16 },
17 },
18 Isarchived: false,
19 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
20 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
21}
Request
1POST /api/1/{accountname}/settings/pricing/ticketfees HTTP/1.1
2Content-Type: application/json
3
4{
5 "name": "Fixed reservation fee",
6 "rules": {
7 "default": [
8 {
9 "saleschannelid": 1,
10 "status": "fixedfee",
11 "value": 1.000000
12 },
13 {
14 "saleschannelid": 2,
15 "status": "fixedfee",
16 "value": 1.000000
17 }
18 ]
19 }
20}
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 123,
6 "name": "Fixed reservation fee",
7 "rules": {
8 "default": [
9 {
10 "saleschannelid": 1,
11 "status": "fixedfee",
12 "value": 1.000000
13 },
14 {
15 "saleschannelid": 2,
16 "status": "fixedfee",
17 "value": 1.000000
18 }
19 ]
20 },
21 "isarchived": false,
22 "createdts": "2014-09-26 15:24:36",
23 "lastupdatets": "2014-09-26 15:24:36"
24}
Request body fields
Field | Description |
---|---|
name string (required) | Name for the ticket fee scheme Example value:"Fixed reservation fee" |
rules TicketfeeRules (required) | Definition of the rules that define when the ticket fee will be applied Example value:{ "default": [ { "saleschannelid": 1, "status": "fixedfee", "value": 1.000000 }, { "saleschannelid": 2, "status": "fixedfee", "value": 1.000000 } ] } |
Type reference: TicketFee
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
name string | Name for the ticket fee scheme Example value:"Fixed reservation fee" |
rules | Definition of the rules that define when the ticket fee will be applied Example value:{ "default": [ { "saleschannelid": 1, "status": "fixedfee", "value": 1.000000 }, { "saleschannelid": 2, "status": "fixedfee", "value": 1.000000 } ] } |
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: TicketFee