Create a new ticketsalesflow

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/system/ticketsalesflows

Example

Request

 1use Ticketmatic\Endpoints\Settings\System\Ticketsalesflows;
 2
 3$result = Ticketsalesflows::create($client, array(
 4    "name" => "Season start 2018",
 5    "availabilityfielddefinition" => "theatre",
 6    "code" => "season2018",
 7    "config" => array(
 8        array(
 9            "from" => "2016-01-01 00:00:00",
10            "until" => "2016-06-15 00:00:00",
11            "widget" => "addtickets",
12            "widgetparams" => array(
13                "flow" => "basketwithcheckout",
14            ),
15        ),
16        array(
17            "from" => "2016-06-15 00:00:00",
18            "until" => "2017-06-15 00:00:00",
19            "widget" => "addtickets",
20            "widgetparams" => array(
21                "flow" => "return",
22            ),
23        ),
24    ),
25    "description" => "Sales flow for the start of the season 2018",
26    "productavailability" => array(
27        26001,
28        26002,
29    ),
30    "supportedparameters" => array(
31        "event",
32        "product",
33    ),
34    "testmode" => false,
35    "ticketsalessetupid" => 1,
36));

Response

 1object(\Ticketmatic\Model\Ticketsalesflow) (10) {
 2  ["id"]=>
 3  int(0)
 4  ["name"]=>
 5  string(17) "Season start 2018"
 6  ["availabilityfielddefinition"]=>
 7  string(7) "theatre"
 8  ["code"]=>
 9  string(10) "season2018"
10  ["config"]=>
11  array(2) {
12    [0]=>
13    object(\Ticketmatic\Model\TicketsalesFlowConfig) (4) {
14      ["from"]=>
15      object(\DateTime) (3) {
16        ["date"]=>
17        string(26) "2016-01-01 00:00:00.000000"
18        ["timezone_type"]=>
19        int(3)
20        ["timezone"]=>
21        string(3) "UTC"
22      }
23      ["until"]=>
24      object(\DateTime) (3) {
25        ["date"]=>
26        string(26) "2016-06-15 00:00:00.000000"
27        ["timezone_type"]=>
28        int(3)
29        ["timezone"]=>
30        string(3) "UTC"
31      }
32      ["widget"]=>
33      string(10) "addtickets"
34      ["widgetparams"]=>
35      array(1) {
36        ["flow"]=>
37        string(18) "basketwithcheckout"
38      }
39    }
40    [1]=>
41    object(\Ticketmatic\Model\TicketsalesFlowConfig) (4) {
42      ["from"]=>
43      object(\DateTime) (3) {
44        ["date"]=>
45        string(26) "2016-06-15 00:00:00.000000"
46        ["timezone_type"]=>
47        int(3)
48        ["timezone"]=>
49        string(3) "UTC"
50      }
51      ["until"]=>
52      object(\DateTime) (3) {
53        ["date"]=>
54        string(26) "2017-06-15 00:00:00.000000"
55        ["timezone_type"]=>
56        int(3)
57        ["timezone"]=>
58        string(3) "UTC"
59      }
60      ["widget"]=>
61      string(10) "addtickets"
62      ["widgetparams"]=>
63      array(1) {
64        ["flow"]=>
65        string(6) "return"
66      }
67    }
68  }
69  ["description"]=>
70  string(43) "Sales flow for the start of the season 2018"
71  ["productavailability"]=>
72  array(2) {
73    [0]=>
74    int(0)
75    [1]=>
76    int(0)
77  }
78  ["supportedparameters"]=>
79  array(2) {
80    [0]=>
81    string(5) "event"
82    [1]=>
83    string(7) "product"
84  }
85  ["testmode"]=>
86  bool(false)
87  ["ticketsalessetupid"]=>
88  int(0)
89}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/ticketsalesflows"
 4)
 5
 6result, err := ticketsalesflows.Create(client, &ticketmatic.Ticketsalesflow{
 7    Name: "Season start 2018",
 8    Availabilityfielddefinition: "theatre",
 9    Code: "season2018",
10    Config: []*ticketmatic.TicketsalesFlowConfig{
11        &ticketmatic.TicketsalesFlowConfig{
12            From: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
13            Until: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-06-15 00:00:00")),
14            Widget: "addtickets",
15            Widgetparams: map[string]string{
16                "flow": "basketwithcheckout",
17            },
18        },
19        &ticketmatic.TicketsalesFlowConfig{
20            From: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-06-15 00:00:00")),
21            Until: ticketmatic.NewTime(ticketmatic.MustParseTime("2017-06-15 00:00:00")),
22            Widget: "addtickets",
23            Widgetparams: map[string]string{
24                "flow": "return",
25            },
26        },
27    },
28    Description: "Sales flow for the start of the season 2018",
29    Productavailability: []int64{
30        26001,
31        26002,
32    },
33    Supportedparameters: []string{
34        "event",
35        "product",
36    },
37    Testmode: false,
38    Ticketsalessetupid: 1,
39})

Response

 1result := &ticketmatic.Ticketsalesflow{
 2    Id: 123,
 3    Name: "Season start 2018",
 4    Availabilityfielddefinition: "theatre",
 5    Code: "season2018",
 6    Config: []*ticketmatic.TicketsalesFlowConfig{
 7        &ticketmatic.TicketsalesFlowConfig{
 8            From: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-01-01 00:00:00")),
 9            Until: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-06-15 00:00:00")),
10            Widget: "addtickets",
11            Widgetparams: map[string]string{
12                "flow": "basketwithcheckout",
13            },
14        },
15        &ticketmatic.TicketsalesFlowConfig{
16            From: ticketmatic.NewTime(ticketmatic.MustParseTime("2016-06-15 00:00:00")),
17            Until: ticketmatic.NewTime(ticketmatic.MustParseTime("2017-06-15 00:00:00")),
18            Widget: "addtickets",
19            Widgetparams: map[string]string{
20                "flow": "return",
21            },
22        },
23    },
24    Description: "Sales flow for the start of the season 2018",
25    Productavailability: []int64{
26        26001,
27        26002,
28    },
29    Supportedparameters: []string{
30        "event",
31        "product",
32    },
33    Testmode: false,
34    Ticketsalessetupid: 1,
35}

Request

 1POST /api/1/{accountname}/settings/system/ticketsalesflows HTTP/1.1
 2Content-Type: application/json
 3
 4{
 5    "name": "Season start 2018",
 6    "availabilityfielddefinition": "theatre",
 7    "code": "season2018",
 8    "config": [
 9        {
10            "from": "2016-01-01 00:00:00",
11            "until": "2016-06-15 00:00:00",
12            "widget": "addtickets",
13            "widgetparams": {
14                "flow": "basketwithcheckout"
15            }
16        },
17        {
18            "from": "2016-06-15 00:00:00",
19            "until": "2017-06-15 00:00:00",
20            "widget": "addtickets",
21            "widgetparams": {
22                "flow": "return"
23            }
24        }
25    ],
26    "description": "Sales flow for the start of the season 2018",
27    "productavailability": [ 26001, 26002 ],
28    "supportedparameters": [
29        "event",
30        "product"
31    ],
32    "testmode": false,
33    "ticketsalessetupid": 1
34}

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "name": "Season start 2018",
 7    "availabilityfielddefinition": "theatre",
 8    "code": "season2018",
 9    "config": [
10        {
11            "from": "2016-01-01 00:00:00",
12            "until": "2016-06-15 00:00:00",
13            "widget": "addtickets",
14            "widgetparams": {
15                "flow": "basketwithcheckout"
16            }
17        },
18        {
19            "from": "2016-06-15 00:00:00",
20            "until": "2017-06-15 00:00:00",
21            "widget": "addtickets",
22            "widgetparams": {
23                "flow": "return"
24            }
25        }
26    ],
27    "description": "Sales flow for the start of the season 2018",
28    "productavailability": [ 26001, 26002 ],
29    "supportedparameters": [
30        "event",
31        "product"
32    ],
33    "testmode": false,
34    "ticketsalessetupid": 1
35}

Request body fields

FieldDescription
name
string 
(required)

Name

Example value:"Season start 2018"
availabilityfielddefinition
string 
(required)

Fielddefinition used to define the availability of events for this flow

Example value:"theatre"
code
string 
(required)

Unique code used for the flow. Should only contain lower case letters and digits

Example value:"season2018"
config
TicketsalesFlowConfig[] 
(required)

Config for the flow

Example value:[ { "from": "2016-01-01 00:00:00", "until": "2016-06-15 00:00:00", "widget": "addtickets", "widgetparams": { "flow": "basketwithcheckout" } }, { "from": "2016-06-15 00:00:00", "until": "2017-06-15 00:00:00", "widget": "addtickets", "widgetparams": { "flow": "return" } } ]
description
string 
(required)

Description

Example value:"Sales flow for the start of the season 2018"
productavailability
int[] 
(required)

For flows with supported parameter ‘product’: the set of ProductTypes for which this flow is available

Example value:[ 26001, 26002 ]
supportedparameters
string[] 
(required)

Supported parameters for the flow

Example value:[ "event", "product" ]
testmode
bool 
(required)

Whether or not the flow is in test mode

        </td>
    </tr><tr>
        <td class="field">
            <div class="name">ticketsalessetupid</div>
            <div class="type">int&nbsp;<div class="required">(required)</div></div>
        </td>
        <td class="description">
            <p>Ticket sales setup this flow belongs to</p> 
            <strong>Example value:</strong><code>1</code>
        </td>
    </tr>
</tbody>

Type reference: Ticketsalesflow

Result fields

FieldDescription
id
int

Unique ID

Example value:123
name
string

Name

Example value:"Season start 2018"
availabilityfielddefinition
string

Fielddefinition used to define the availability of events for this flow

Example value:"theatre"
code
string

Unique code used for the flow. Should only contain lower case letters and digits

Example value:"season2018"
config

Config for the flow

Example value:[ { "from": "2016-01-01 00:00:00", "until": "2016-06-15 00:00:00", "widget": "addtickets", "widgetparams": { "flow": "basketwithcheckout" } }, { "from": "2016-06-15 00:00:00", "until": "2017-06-15 00:00:00", "widget": "addtickets", "widgetparams": { "flow": "return" } } ]
description
string

Description

Example value:"Sales flow for the start of the season 2018"
productavailability
int[]

For flows with supported parameter ‘product’: the set of ProductTypes for which this flow is available

Example value:[ 26001, 26002 ]
supportedparameters
string[]

Supported parameters for the flow

Example value:[ "event", "product" ]
testmode
bool

Whether or not the flow is in test mode

ticketsalessetupid
int

Ticket sales setup this flow belongs to

Example value:1

Type reference: Ticketsalesflow