Create a new order fee definition

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/pricing/orderfeedefinitions

Example

Request

 1use Ticketmatic\Endpoints\Settings\Pricing\Orderfeedefinitions;
 2
 3$result = Orderfeedefinitions::create($client, array(
 4    "typeid" => 2401,
 5    "name" => "Payment cost",
 6    "rule" => array(
 7        "auto" => array(
 8            array(
 9                "paymentscenarioids" => array(
10                    2,
11                ),
12                "status" => "percentagefee",
13                "value" => 3,
14            ),
15        ),
16    ),
17));

Response

 1object(\Ticketmatic\Model\OrderFeeDefinition) (8) {
 2  ["id"]=>
 3  int(0)
 4  ["typeid"]=>
 5  int(0)
 6  ["name"]=>
 7  string(12) "Payment cost"
 8  ["rule"]=>
 9  object(\Ticketmatic\Model\OrderfeeRule) (1) {
10    ["auto"]=>
11    array(1) {
12      [0]=>
13      object(\Ticketmatic\Model\OrderfeeAutoRule) (3) {
14        ["paymentscenarioids"]=>
15        array(1) {
16          [0]=>
17          int(0)
18        }
19        ["status"]=>
20        string(13) "percentagefee"
21        ["value"]=>
22        float(3.000000)
23      }
24    }
25  }
26  ["isarchived"]=>
27  bool(false)
28  ["archivedts"]=>
29  object(\DateTime) (3) {
30    ["date"]=>
31    string(26) "2014-09-26 15:24:36.000000"
32    ["timezone_type"]=>
33    int(3)
34    ["timezone"]=>
35    string(3) "UTC"
36  }
37  ["createdts"]=>
38  object(\DateTime) (3) {
39    ["date"]=>
40    string(26) "2014-09-26 15:24:36.000000"
41    ["timezone_type"]=>
42    int(3)
43    ["timezone"]=>
44    string(3) "UTC"
45  }
46  ["lastupdatets"]=>
47  object(\DateTime) (3) {
48    ["date"]=>
49    string(26) "2014-09-26 15:24:36.000000"
50    ["timezone_type"]=>
51    int(3)
52    ["timezone"]=>
53    string(3) "UTC"
54  }
55}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/pricing/orderfeedefinitions"
 4)
 5
 6result, err := orderfeedefinitions.Create(client, &ticketmatic.OrderFeeDefinition{
 7    Typeid: 2401,
 8    Name: "Payment cost",
 9    Rule: &ticketmatic.OrderfeeRule{
10        Auto: []*ticketmatic.OrderfeeAutoRule{
11            &ticketmatic.OrderfeeAutoRule{
12                Paymentscenarioids: []int64{
13                    2,
14                },
15                Status: "percentagefee",
16                Value: 3,
17            },
18        },
19    },
20})

Response

 1result := &ticketmatic.OrderFeeDefinition{
 2    Id: 123,
 3    Typeid: 2401,
 4    Name: "Payment cost",
 5    Rule: &ticketmatic.OrderfeeRule{
 6        Auto: []*ticketmatic.OrderfeeAutoRule{
 7            &ticketmatic.OrderfeeAutoRule{
 8                Paymentscenarioids: []int64{
 9                    2,
10                },
11                Status: "percentagefee",
12                Value: 3,
13            },
14        },
15    },
16    Isarchived: false,
17    Archivedts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
18    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
19    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
20}

Request

 1POST /api/1/{accountname}/settings/pricing/orderfeedefinitions HTTP/1.1
 2Content-Type: application/json
 3
 4{
 5    "typeid": 2401,
 6    "name": "Payment cost",
 7    "rule": {
 8        "auto": [
 9            {
10                "paymentscenarioids": [ 2 ],
11                "status": "percentagefee",
12                "value": 3.000000
13            }
14        ]
15    }
16}

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "typeid": 2401,
 7    "name": "Payment cost",
 8    "rule": {
 9        "auto": [
10            {
11                "paymentscenarioids": [ 2 ],
12                "status": "percentagefee",
13                "value": 3.000000
14            }
15        ]
16    },
17    "isarchived": false,
18    "archivedts": "2014-09-26 15:24:36",
19    "createdts": "2014-09-26 15:24:36",
20    "lastupdatets": "2014-09-26 15:24:36"
21}

Request body fields

FieldDescription
typeid
int 
(required)

Type of the order fee. Can be Automatic (2401), Script (2402) or Manual (2403)

Example value:2401
name
mlstring 
(required)

Name for the order fee

Example value:"Payment cost"
rule
OrderfeeRule 
(required)

Definition of the rule that defines when the order fee will be applied

Example value:{ "auto": [ { "paymentscenarioids": [ 2 ], "status": "percentagefee", "value": 3.000000 } ] }

Type reference: OrderFeeDefinition

Result fields

FieldDescription
id
int

Unique ID

Example value:123
typeid
int

Type of the order fee. Can be Automatic (2401), Script (2402) or Manual (2403)

Example value:2401
name

Name for the order fee

Example value:"Payment cost"
rule

Definition of the rule that defines when the order fee will be applied

Example value:{ "auto": [ { "paymentscenarioids": [ 2 ], "status": "percentagefee", "value": 3.000000 } ] }
isarchived
bool

Whether or not this item is archived

archivedts
timestamp

Archived timestamp

Example value:"2014-09-26 15:24:36"
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: OrderFeeDefinition