Get a list of price types

Content

Resource URL

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

Example

Request

 1use Ticketmatic\Endpoints\Settings\Pricing\Pricetypes;
 2
 3$result = Pricetypes::getlist($client, array(
 4    "filter" => "SELECT id FROM tm.pricetype WHERE createdts > (now() - INTERVAL '1 year')",
 5    "includearchived" => true,
 6    "lastupdatesince" => "2014-09-26 15:24:36",
 7));
 8
 9// The parameters array is optional, it can be omitted when empty.
10$result = Pricetypes::getlist($client);

Response

 1object(Ticketmatic\Endpoints\Settings\Pricing\PricetypesList) (1) {
 2  ["data"]=>
 3  array(1) {
 4    [0]=>
 5    object(\Ticketmatic\Model\PriceType) (7) {
 6      ["id"]=>
 7      int(0)
 8      ["typeid"]=>
 9      int(0)
10      ["name"]=>
11      string(7) "Student"
12      ["remark"]=>
13      string(31) "Only valid with a student card."
14      ["isarchived"]=>
15      bool(false)
16      ["createdts"]=>
17      object(\DateTime) (3) {
18        ["date"]=>
19        string(26) "2014-09-26 15:24:36.000000"
20        ["timezone_type"]=>
21        int(3)
22        ["timezone"]=>
23        string(3) "UTC"
24      }
25      ["lastupdatets"]=>
26      object(\DateTime) (3) {
27        ["date"]=>
28        string(26) "2014-09-26 15:24:36.000000"
29        ["timezone_type"]=>
30        int(3)
31        ["timezone"]=>
32        string(3) "UTC"
33      }
34    }
35  }
36}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/pricing/pricetypes"
 4)
 5
 6result, err := pricetypes.Getlist(client, &ticketmatic.PriceTypeQuery{
 7    Filter: "SELECT id FROM tm.pricetype WHERE createdts > (now() - INTERVAL '1 year')",
 8    Includearchived: true,
 9    Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10})
11
12// The query object is optional, it can be omitted when empty.
13result, err := pricetypes.Getlist(client, nil)

Response

 1result := pricetypes.&List{
 2    Data: []*ticketmatic.PriceType{
 3        &ticketmatic.PriceType{
 4            Id: 123,
 5            Typeid: 2301,
 6            Name: "Student",
 7            Remark: "Only valid with a student card.",
 8            Isarchived: false,
 9            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
11        },
12    },
13}

Request

1GET /api/1/{accountname}/settings/pricing/pricetypes HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "data": [
 6        {
 7            "id": 123,
 8            "typeid": 2301,
 9            "name": "Student",
10            "remark": "Only valid with a student card.",
11            "isarchived": false,
12            "createdts": "2014-09-26 15:24:36",
13            "lastupdatets": "2014-09-26 15:24:36"
14        }
15    ]
16}

Parameters

FieldDescription
filter

Filter the returned items by specifying a query on the public datamodel that returns the ids.

Example value:"SELECT id FROM tm.pricetype WHERE createdts > (now() - INTERVAL '1 year')"
includearchived

If this parameter is true, archived items will be returned as well.

Example value:true
lastupdatesince

All items that were updated since this timestamp will be returned. Timestamp should be passed in YYYY-MM-DD hh:mm:ss format.

Example value:"2014-09-26 15:24:36"

Type reference: PriceTypeQuery

Result fields

This call returns an object with an array of objects in the data field.

FieldDescription
id
int

Unique ID

Example value:123
typeid
int

The category of this price type, defines how the price is displayed. The available values for this field can be found on the price type overview page.

Example value:2301
name

Name of the price type

Example value:"Student"
remark

A remark that describes the price type. Will be shown to customers.

Example value:"Only valid with a student card."
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"

This type can have custom fields.

Type reference: PriceType[]