Modify an existing product category

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/productcategories/{id}

Example

Request

1use Ticketmatic\Endpoints\Settings\Productcategories;
2
3$result = Productcategories::update($client, $id, array(
4    "name" => "serie",
5    "contactname" => "holder",
6    "contactnameplural" => "holders",
7    "nameplural" => "series",
8));

Response

 1object(\Ticketmatic\Model\ProductCategory) (8) {
 2  ["id"]=>
 3  int(0)
 4  ["name"]=>
 5  string(5) "serie"
 6  ["contactname"]=>
 7  string(6) "holder"
 8  ["contactnameplural"]=>
 9  string(7) "holders"
10  ["nameplural"]=>
11  string(6) "series"
12  ["isarchived"]=>
13  bool(false)
14  ["createdts"]=>
15  object(\DateTime) (3) {
16    ["date"]=>
17    string(26) "2014-09-26 15:24:36.000000"
18    ["timezone_type"]=>
19    int(3)
20    ["timezone"]=>
21    string(3) "UTC"
22  }
23  ["lastupdatets"]=>
24  object(\DateTime) (3) {
25    ["date"]=>
26    string(26) "2014-09-26 15:24:36.000000"
27    ["timezone_type"]=>
28    int(3)
29    ["timezone"]=>
30    string(3) "UTC"
31  }
32}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/productcategories"
 4)
 5
 6result, err := productcategories.Update(client, id, &ticketmatic.ProductCategory{
 7    Name: "serie",
 8    Contactname: "holder",
 9    Contactnameplural: "holders",
10    Nameplural: "series",
11})

Response

 1result := &ticketmatic.ProductCategory{
 2    Id: 123,
 3    Name: "serie",
 4    Contactname: "holder",
 5    Contactnameplural: "holders",
 6    Nameplural: "series",
 7    Isarchived: false,
 8    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 9    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10}

Request

1PUT /api/1/{accountname}/settings/productcategories/{id} HTTP/1.1
2Content-Type: application/json
3
4{
5    "name": "serie",
6    "contactname": "holder",
7    "contactnameplural": "holders",
8    "nameplural": "series"
9}

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "name": "serie",
 7    "contactname": "holder",
 8    "contactnameplural": "holders",
 9    "nameplural": "series",
10    "isarchived": false,
11    "createdts": "2014-09-26 15:24:36",
12    "lastupdatets": "2014-09-26 15:24:36"
13}

Request body fields

FieldDescription
name
mlstring 
(required)

Name for the product category

Example value:"serie"
contactname
mlstring 
(required)

Name for the holder/owner of this product

Example value:"holder"
contactnameplural
mlstring 
(required)

Name for the holder/owner of this product in plural

Example value:"holders"
nameplural
mlstring 
(required)

Name for the product category in plural

Example value:"series"

Type reference: ProductCategory

Result fields

FieldDescription
id
int

Unique ID

Example value:123
name

Name for the product category

Example value:"serie"
contactname

Name for the holder/owner of this product

Example value:"holder"
contactnameplural

Name for the holder/owner of this product in plural

Example value:"holders"
nameplural

Name for the product category in plural

Example value:"series"
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: ProductCategory