Item categories¶
Resource description¶
Categories provide grouping for items (better known as products). The category resource contains the following public fields:
Field |
Type |
Description |
|---|---|---|
id |
integer |
Internal ID of the category |
name |
multi-lingual string |
The category’s visible name |
internal_name |
string |
An optional name that is only used in the backend |
description |
multi-lingual string |
A public description (might include markdown, can
be |
position |
integer |
An integer, used for sorting the categories |
is_addon |
boolean |
If |
cross_selling_mode |
string |
If |
cross_selling_condition |
string |
Only relevant if |
cross_selling_match_products |
list of integer |
Only relevant if |
Endpoints¶
- GET /api/v1/organizers/(organizer)/events/(event)/categories/¶
Returns a list of all categories within a given event.
Example request:
GET /api/v1/organizers/bigevents/events/sampleconf/categories/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "name": {"en": "Tickets"}, "internal_name": "", "description": {"en": "Tickets are what you need to get in."}, "position": 1, "is_addon": false, "cross_selling_mode": null, "cross_selling_condition": null, "cross_selling_match_products": [] } ] }
- Query Parameters:
page (integer) – The page number in case of a multi-page result set, default is 1
is_addon (boolean) – If set to
trueorfalse, only categories with this value for the fieldis_addonwill be returned.ordering (string) – Manually set the ordering of results. Valid fields to be used are
idandposition. Default:position
- Parameters:
organizer – The
slugfield of the organizer to fetchevent – The
slugfield of the event to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.
- GET /api/v1/organizers/(organizer)/events/(event)/categories/(id)/¶
Returns information on one category, identified by its ID.
Example request:
GET /api/v1/organizers/bigevents/events/sampleconf/categories/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 1, "name": {"en": "Tickets"}, "internal_name": "", "description": {"en": "Tickets are what you need to get in."}, "position": 1, "is_addon": false, "cross_selling_mode": null, "cross_selling_condition": null, "cross_selling_match_products": [] }
- Parameters:
organizer – The
slugfield of the organizer to fetchevent – The
slugfield of the event to fetchid – The
idfield of the category to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.
- POST /api/v1/organizers/(organizer)/events/(event)/categories/¶
Creates a new category
Example request:
POST /api/v1/organizers/bigevents/events/sampleconf/categories/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json { "name": {"en": "Tickets"}, "internal_name": "", "description": {"en": "Tickets are what you need to get in."}, "position": 1, "is_addon": false, "cross_selling_mode": null, "cross_selling_condition": null, "cross_selling_match_products": [] }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json { "id": 1, "name": {"en": "Tickets"}, "internal_name": "", "description": {"en": "Tickets are what you need to get in."}, "position": 1, "is_addon": false, "cross_selling_mode": null, "cross_selling_condition": null, "cross_selling_match_products": [] }
- Parameters:
organizer – The
slugfield of the organizer of the event to create a category forevent – The
slugfield of the event to create a category for
- Status Codes:
201 Created – no error
400 Bad Request – The category could not be created due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to create this resource.
- PATCH /api/v1/organizers/(organizer)/events/(event)/categories/(id)/¶
Update a category. You can also use
PUTinstead ofPATCH. WithPUT, you have to provide all fields of the resource, other fields will be reset to default. WithPATCH, you only need to provide the fields that you want to change.You can change all fields of the resource except the
idfield.Example request:
PATCH /api/v1/organizers/bigevents/events/sampleconf/categories/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json Content-Length: 94 { "is_addon": true }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 1, "name": {"en": "Tickets"}, "internal_name": "", "description": {"en": "Tickets are what you need to get in."}, "position": 1, "is_addon": true, "cross_selling_mode": null, "cross_selling_condition": null, "cross_selling_match_products": [] }
- Parameters:
organizer – The
slugfield of the organizer to modifyevent – The
slugfield of the event to modifyid – The
idfield of the category to modify
- Status Codes:
200 OK – no error
400 Bad Request – The category could not be modified due to invalid submitted data
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to change this resource.
- DELETE /api/v1/organizers/(organizer)/events/(event)/category/(id)/¶
Delete a category.
Example request:
DELETE /api/v1/organizers/bigevents/events/sampleconf/categories/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 204 No Content Vary: Accept
- Parameters:
organizer – The
slugfield of the organizer to modifyevent – The
slugfield of the event to modifyid – The
idfield of the category to delete
- Status Codes:
204 No Content – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to delete this resource.